2017-12-13 23:05:21 +08:00
|
|
|
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
|
2015-07-25 15:24:00 +08:00
|
|
|
module.exports = {
|
|
|
|
node: {
|
|
|
|
__dirname: false,
|
|
|
|
__filename: false
|
|
|
|
},
|
|
|
|
entry: {
|
2017-11-09 04:21:33 +08:00
|
|
|
ie8: ["./ie8.js"],
|
2015-07-25 15:24:00 +08:00
|
|
|
bundle0: ["./index.js"],
|
2016-12-17 05:19:06 +08:00
|
|
|
vendors: ["./vendors.js"],
|
2017-03-05 10:31:39 +08:00
|
|
|
extract: ["./extract.js"],
|
|
|
|
compress: ["./compress.js"]
|
2015-07-25 15:24:00 +08:00
|
|
|
},
|
|
|
|
output: {
|
|
|
|
filename: "[name].js"
|
|
|
|
},
|
2017-12-13 23:05:21 +08:00
|
|
|
optimization: {
|
|
|
|
minimize: true,
|
|
|
|
minimizer: [
|
|
|
|
new UglifyJsPlugin({
|
2018-02-25 09:00:20 +08:00
|
|
|
exclude: ["vendors.js", "extract.js"]
|
2017-12-13 23:05:21 +08:00
|
|
|
}),
|
|
|
|
new UglifyJsPlugin({
|
|
|
|
extractComments: true,
|
2018-02-25 09:00:20 +08:00
|
|
|
include: ["extract.js"]
|
2017-12-13 23:05:21 +08:00
|
|
|
}),
|
|
|
|
new UglifyJsPlugin({
|
|
|
|
uglifyOptions: {
|
|
|
|
compress: {
|
|
|
|
passes: 2
|
|
|
|
}
|
|
|
|
},
|
2018-02-25 09:00:20 +08:00
|
|
|
include: ["compress.js"]
|
2017-12-13 23:05:21 +08:00
|
|
|
})
|
|
|
|
]
|
|
|
|
}
|
2015-07-25 15:24:00 +08:00
|
|
|
};
|