-
-
Notifications
You must be signed in to change notification settings - Fork 384
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
Different import order leads to multiple vendor bundles #135
Comments
@wyntau Thanks for issue, we known this problem and already fixed this problem, just wait improve documentation webpack/webpack.js.org#2096. Thanks! Feel free to feedback! |
@wyntau I will leave open because looks like you have other issue around code splitting, right? |
Does it mean I can now replace all |
@wyntau yes, |
@evilebottnawi
|
@wyntau looks like problem with |
this is the newest zip
|
hi @evilebottnawi , do you have any idea why will two vendor files with the same content be generated? |
The |
@michael-ciniawsky not yet |
Closing due to inactivity. Please test with latest version and feel free to reopen if still regressions. Thanks! |
Condition
Suppose I have a project have two entry file
foo-entry.js
andbar-entry.js
, both of them importes6-promise
andnormalize.css
. Additionallyfoo-entry
may also import other modules, e.g.object-assign
.Now I want to split both shared node_modules
es6-promise
andnormalize.css
toshared-vendor.js
andshared-vendor.css
(use mini-css-extract-plugin to extract out fromshared-vendor.js
), and splitobject-assign
tofoo-vendor.js
.So on foo page, I add
shared-vendor.js
,foo-vendor.js
,foo-entry.js
to script tag in htmlAnd on bar page, I add
shared-vendor.js
andbar-entry.js
to script tag in html.Reproduce
To do this, I pass a config array to webpack. the config like below. The only difference is two entry name
Expected result
Generate four files.
foo-entry.pack.[chunkhash].js
bar-entry.pack.[chunkhash].js
shared-vendor.pack.[chunkhash].js
, includees6-promise
shared-vendor.pack.[chunkhash].css
, includenormalize.css
Actual result
Generate six files. Two shared-vendor.js and two shared-vendor.css with the very same content
foo-entry.pack.[chunkhash].js
bar-entry.pack.[chunkhash].js
shared-vendor.pack.[chunkhash-1].js
, includees6-promise
shared-vendor.pack.[chunkhash-1].css
, includenormalize.css
shared-vendor.pack.[chunkhash-2].js
, includees6-promise
shared-vendor.pack.[chunkhash-2].css
, includenormalize.css
Search and find
style-loader
(the commented line on above webpack config), only oneshared-vendor.pack.[chunkhash].js
andshared-vendor.pack.[chunkhash].css
will be generated.bar-entry.js
, firstly importnormalize.css
and then importes6-promise
likefoo-entry
, it will also generate only oneshared-vendor.pack.[chunkhash].js
andshared-vendor.pack.[chunkhash].css
.Problem
[name]-vendor
?Reproduce project
reproduce.zip
To mininal reproduce, I removed all other modules. So foo-entry and bar-entry will only import two modules
es6-promise
andnormalize.css
and have no any other codeEnvironment
The text was updated successfully, but these errors were encountered: