-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
T281510 Serve plugin assets individually (unbundled) #7
Conversation
Okay, the current bash script works now. You can check out by just The only leftover thing is reworking the bash script to make it looks more professional. at the same time, you can review it. |
The script doesn't work for me. There's no content in the submodule. What do I need to do? |
Ok, it should work now in one command |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't really work for me. The images are always embedded.
This PR will require another update to replace most of the bash script (compiled js and css part) after this wikimedia/wikipedia-preview#113 is done. |
scripts/postinstall.sh
Outdated
cd wikipedia-preview | ||
git reset --hard | ||
npm i | ||
EXTERNAL_IMAGE_PATH='/wp-content/plugins/wikipediapreview-wordpress/assets/images' npm run build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This path is problematic. Different setups can have different url structures. Plugins are expected to call php functions to get info like this.
A simple way to work around that is to put the images dir under the styles dir and use urls like images/xxx.svg
. However, since we don't include the style as a file but as an inline <style> tag created by js, the style relative path is the document, which is close to the root, far away from the plugins.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make sense, the update is here 2d46a13
partially done in #101, reopen this ticket if needed. |
Phabricator Ticket : https://phabricator.wikimedia.org/T281510
Step by Step
npm bun build
in the submoduleassets