-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
Webpack to load files as chunks and not bundle up into one-Dynamic require #3364
Comments
If you are using webpack v2, you can use |
Or if you are not on latest webpack 2 beta, you can use |
I'm running into the same issue with require.ensure generating one bundle for all files in the same directory/context. It'd be nice if we had some kind of control over how/when it groups things from the same context into a giant bundle. System.import (I assume it's the same for import) is not a workable solution for me, because it doesn't support several features that require.ensure does:
Let's say we have 3 libraries:
So basically, libraryB and libraryC both require/import libraryA. Using require.ensure, we can do the following:
The resulting bundles will be:
Using System.import, we can do the following:
The resulting bundles will be:
I know that using code splitting recursively like this is not very common, but it has been a very powerful feature to reduce bundle sizes on projects I've worked on. I guess the named chunks are something I could live without (although you can see with examples like recursive splitting how useful they are). But I really don't want to give up the clever bundle-size reduction require.ensure gives, unless it can be replicated in System.import / import. |
This issue had no activity for at least half a year. It's subject to automatic issue closing if there is no activity in the next 15 days. |
Issue was closed because of inactivity. If you think this is still a valid issue, please file a new issue with additional information. |
I want to load the translation files(react-intl-yahoo lib). I want the webpack to load seperate chunks of files at the compile time instead of bundling them up into one. I tried using the require.ensure to optimize loading of locale data files:
but I see that Webpack is loading the entire languages-folder with all the files bundled during compile time instead a separate one.
What is the best way to chunk the translation files separately and load asynchronously at the compile time?
The text was updated successfully, but these errors were encountered: