Do you want to request a feature or report a bug?
bug.
What is the current behavior?
I use webpack4.20.2 and Dllplugin to pack react and antd, but there are some errors caused by uglyfyjs.
If the current behavior is a bug, please provide the steps to reproduce.
.babelrc
{
"presets": [
"env",
"stage-0",
"react"
],
"plugins": [
["import", { "libraryName": "antd", "style": "css" }]
]
}
dll.config.js
module.exports = {
entry: {
vendor: ['react', 'react-dom', 'antd']
},
output: {
filename: '[name].[chunkhash].js',
path: dist,
library: '[name].[chunkhash]'
},
plugins: [
new webpack.DllPlugin({
path: path.resolve(dist, 'manifest.json'),
name: '[name].[chunkhash]'
})
]
}
I run script npx webpack --config ./webpack/dll.config.js --mode production
error
ERROR in vendor.d2b0d173f1df51d080c7.js from UglifyJs
Unexpected token: punc (.) [vendor.d2b0d173f1df51d080c7.js:1,10]
error Command failed with exit code 2.
What is the expected behavior?
It should work, sorry for my english
If this is a feature request, what is motivation or use case for changing the behavior?
Please mention other relevant information such as the browser version, Node.js version, webpack version, and Operating System.
finally I found the reason.Just change output.library and plugins.name into: ‘[name]_[chunkhash]’.The dot . seems destory everything.