-
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
missing files foundation.core.utils.js and foundation.core.plugin.js in dist/js/plugins #11614
Comments
Hi @Lemmork, Please use the template we provide when submitting an issue: https://github.com/zurb/foundation-sites/issues/new?template=1-bug-report.md I don't know how you installed or updated Foundation. NPM ? Foundation CLI ? Customizer ? CDN ? All this aside, I am sorry, I forgot to say in the release notes that 2 files has been renamed:
Please give more informations about your installation and follow the template we provide so we can know if this issue could affect others people and how to resolve it. |
Hi @ncoden , sorry for writing only a short description. I will try again: What should happen?If I define a js-file for requireJs and require e.g. dist/js/plugin/foundation.accordion.js, requireJs should resolve the dependencies defined in dist/js/plugin/foundation.accordion.js. What happens instead?The requirements for dist/js/plugin/foundation.core.utils.js and dist/js/plugin/foundation.core.plugin.js could not be resolved, because these files do not exist. Possible SolutionProvide dist/js/plugin/foundation.core.utils.js and dist/js/plugin/foundation.core.plugin.js files I want to include only the JS-Plugins I really need, not the whole foundation JS: |
So the issue is not that these files are missing from the dist folder, but that you import and build Foundation in a way that make the loader looking for imported properties in the original source files. At first, please check that you imported the Then, Could you precisely describe:
Thank you. |
Hi @ncoden perhaps I'm on the wrong track. I love the foundation framework, because I can use only the parts I need and keep my project really small. My project is build upon a cms and what I want to achieve is that only the javasript is loaded which are needed by the components on a specific page. Before Version 6.5.1 I used the JS-files in need from node_modules/foundation-sites/dist/js/plugins and did a merge and transpilation (babel) with gulp to a new merged js-File, which was included by my project. Its a similar approach to the way described here: https://foundation.zurb.com/sites/docs/javascript.html#import-in-html As I read, that 6.5.1 supports requireJS (https://foundation.zurb.com/sites/docs/javascript.html#import-in-javascript) I tried to copy all jsFiles I need from node_modules/foundation-sites/dist/js/plugins without any merging or transpitation to my project-js-directory and use requireJS to resolve the dependencies. Therfore requireJS tries to find the js-Files, which are defined in the file (eg: node_modules/foundation-sites/dist/js/plugins/foundation.accordion.js) loading fails if the files do not exist. Maybe it is not intended, to load single js-packages with requireJS. |
Ok @Lemmork, now I understand the issue. The generated plugin files in define(["./foundation.core", "./foundation.core.plugin", "./foundation.core.utils", "./foundation.util.keyboard", "jquery"], factory); There is something wrong with our bundling process. I'll investigate this. |
I found when the issue comes from. Our webpack configuration for externals is not as it should be. The AMD and CJS entries should be the retargeted file. Here is how it should be changed: './jquery': {
root: 'jQuery',
amd: './jquery',
commonjs: './jquery',
commonjs2: './jquery',
},
'./foundation.core.plugin': {
root: 'foundation.core',
-- amd: './foundation.core.plugin',
++ amd: './foundation.core',
-- commonjs: './foundation.core.plugin',
++ commonjs: './foundation.core',
-- commonjs2: './foundation.core.plugin',
++ commonjs2: './foundation.core',
},
(...) |
Could we have seen / caught this with a simple single test? Just to make sure that every variant works in its simplest form. |
Yes. I tested the main file |
Fixed by #11618. |
I'm using foundation-sites 6.5.1 and use requirejs to load only nessesary foundation JS files.
When I try to require foundation.accordion.js from the dist/js/plugins folder, the loader requires foundation.core.utils.js and foundation.core.plugin.js, which do not exist.
Could you please provide these files in next release
The text was updated successfully, but these errors were encountered: