use webpack dll to package dependent packages and put react into the module packaged by dll.
when the packaging is complete, the app.bundle.js still contains the source code of react. Could you tell me what to do with the change?
webpack.dll.js
module.exports = {
entry: {
polyfill: ["babel-polyfill", "whatwg-fetch", "es6-promise"],
common: ["history", "md5", "object-path", "lokijs", "object-assign", "classnames"],
react: ["react", "react-dom"],
reactRedux: ["react-redux", "redux", "redux-observable"],
reactRouter: ["react-router-dom", "react-router-redux"]
},
output: {
path: path.join(__dirname, buildDir),
filename: "[name].dll.js",
library: "[name]_[hash]"
},
context: path.resolve(__dirname),
mode: NODE_ENV,
devtool: "source-map",
plugins: [
new CleanWebpackPlugin([buildDir]),
new webpack.DefinePlugin({
"process.env.NODE_ENV": JSON.stringify(NODE_ENV)
}),
new webpack.DllPlugin({
path: path.join(__dirname, buildDir, "[name].manifest.json"),
name: "[name]_[hash]",
context: __dirname
})
]
};