-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
fix: fix imports for AMD/CommonJs #11618
Conversation
Make the plugins looking for "./plugin" instead of "plugin" for AMD/CommonJs formats
Use names without "./" when searching for modules as root variables (in module-less environments) to correctly match the generated root variables, which are the name of the file (without any prefix).
I added tests for the AMD import only because Foundation is not compatible for the native Node environment (without browser features) and there is no implementation for CommonJs in the browser. |
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.
See my comments.
In general we should try to use rollup as best as possible as this provides the UMD and AMD wrappers.
I checked out this pull request locally and the js files have version 6.4.3. |
@Lemmork |
ec34586
to
a69a577
Compare
@DanielRuf It would be great to fully migrate from Webpack to Rollup for the javascript, but this adds a lot of work. If you think it worth it, go ahead and submit a PR. I'm also curious to see how you will test the AMD bundle import. I'm merging this for now to release a patch quickly, but some refactor to have a lighter build process in future versions would be welcome! |
Right. Currently I'm mainly working on ecommerce projects at work but there should be a new Foundation based project in the next weeks where I can test the bundles with the colleagues in the project initialization and setup phase. |
….5.0 4d9270f chore: fix plugins UMD external names 7f5aa78 docs: add documentation for the webpack UMD configuration 4124057 chore: fix plugins' UMD root variables names 3fa6741 test: add test for imports via AMD 91353db docs: improve description for the webpack externals config in build script a69a577 docs: improve docs for the root namespace in build script 5e42209 docs: improve docs of the "getUmdEntry" build utility Signed-off-by: Nicolas Coden <[email protected]>
This pull request has been mentioned on Foundation Open Source Community. There might be relevant details there: https://foundation.discourse.group/t/foundation-for-sites-v6-6-0-is-here-farout/30/1 |
Description
Fix imports of the UMD files for AMD and CommonJS environments.
Changes:
./plugin
instead ofplugin
for AMD/CommonJs formats.Todo:
Types of changes
Checklist
develop
ordevelop-v...
).I have updated the documentation accordingly to my changes (if relevant).