1. Frequent build is required in the project, plug-ins are often built and slow to use dllplugin to separate third-party libraries that do not need to be re-packaged
const path = require("path");
const webpack = require("webpack");
module.exports = {
entry: {
vendor: [
"vue/dist/vue.esm.js",
"vue-router",
"babel-polyfill"
]
},
output: {
path: path.join(__dirname, "../static/js"),
filename: "[name].dll.js",
library: "[name]_library"
},
plugins: [
new webpack.DllPlugin({
path: path.join(__dirname, ".", "[name]-manifest.json"),
name: "[name]_library"
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false,
drop_console:true,
drop_debugger:true
},
output:{
comments: false,
},
sourceMap: true
})
]
};
as shown in the figure, there are several third-party libraries under node_modules
question 1: do so many third-party libraries under node_modules need to be listed here one by one?
question 2: what if I want to ignore the files in the specified folder?