You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
More Clarity In Docs Needed on Limitations of Dynamic Imports in Webpack 2 #1083
This page in the docs only has a quick sentence about how import statements cannot be "fully" dynamic, but can be partly.
Keep in mind that import() path cannot be fully dynamic (e.g., import(Math.random())). Rather either completely static (e.g., import('./locale/de.json')) or partially static (e.g., import('./locale/' + language + '.json')).
Ideally the docs would provide details on when and how variable names can be used in import statements. For example, something like this doesn't work.
it would be helpful if there was more detail about when dynamic import paths are allowed and what parts of them can be dynamic (it seems like the beginning needs to be static?).
Thanks for the help! I appreciate all of the work you all do on this.
Activity
bdwain commentedon Apr 6, 2017
Also I'm happy to make the pr to the docs. I just need the questions answered before I can do it. Thanks!
simon04 commentedon Apr 6, 2017
The relevant source code is: https://github.com/webpack/webpack/blob/master/lib/dependencies/ContextDependencyHelpers.js
In a PR, please replace
Math.random()with a more practical code sample.