- Notifications
You must be signed in to change notification settings - Fork2.1k
webpack 4 upgrade#293
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -56,17 +56,16 @@ module.exports = { | ||
maxEntrypointSize: 300000, | ||
hints: isProd ? 'warning' : false | ||
}, | ||
mode: process.env.NODE_ENV || 'development', | ||
plugins: isProd | ||
? [ | ||
new webpack.optimize.ModuleConcatenationPlugin(), | ||
new ExtractTextPlugin({ | ||
filename: 'common.[chunkhash].css', | ||
allChunks: true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Why change it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. "extract-text-webpack-plugin" get error : TypeError: Cannot read property 'call' of undefined There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. @RezaHaidari I can't see any issues with existing ExtractTextPlugin config. Also following config isn't needed as well I guess as by setting mode to production it minifies the code anyway.
Any comments? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. | ||
}) | ||
] | ||
: [ | ||
new FriendlyErrorsPlugin() | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -16,29 +16,32 @@ const config = merge(base, { | ||
plugins: [ | ||
// strip dev-only code in Vue source | ||
new webpack.DefinePlugin({ | ||
'process.env.VUE_ENV': '"client"' | ||
}), | ||
new VueSSRClientPlugin() | ||
], | ||
optimization:{ | ||
runtimeChunk: { | ||
name: "manifest" | ||
}, | ||
// extract webpack runtime & manifest to avoid vendor chunk hash changing | ||
// on every build. | ||
// extract vendor chunks for better caching | ||
splitChunks:{ | ||
chunks:"initial", | ||
cacheGroups: { | ||
vendors: function (module) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I tried your code using webpack 4.23.1 and it fails with a "TypeError: cacheGroup.getName is not a function"
| ||
// a module is extracted into the vendor chunk if... | ||
return ( | ||
// it's inside node_modules | ||
/node_modules/.test(module.context) && | ||
// and not a CSS file (due to extract-text-webpack-plugin limitation) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more.
I wondering if | ||
!/\.css$/.test(module.request) | ||
) | ||
} | ||
} | ||
} | ||
}, | ||
}) | ||
if (process.env.NODE_ENV === 'production') { | ||
Uh oh!
There was an error while loading.Please reload this page.