|
@@ -42,6 +42,15 @@ let proxy = {
|
|
|
// }
|
|
|
|
|
|
var webpack = require("webpack");
|
|
|
+
|
|
|
+const plugins = [];
|
|
|
+// Ignore all locale files of moment.js
|
|
|
+// TODO: use webpack stats to check if iview locale matters
|
|
|
+plugins.push(new webpack.IgnorePlugin(/^\.\/locale$/, /moment|iview$/));
|
|
|
+if (process.env.NODE_ENV === "production") {
|
|
|
+ plugins.push("transform-remove-console");
|
|
|
+}
|
|
|
+
|
|
|
module.exports = {
|
|
|
devServer: {
|
|
|
proxy
|
|
@@ -59,10 +68,6 @@ module.exports = {
|
|
|
.end();
|
|
|
},
|
|
|
configureWebpack: {
|
|
|
- plugins: [
|
|
|
- // Ignore all locale files of moment.js
|
|
|
- // TODO: use webpack stats to check if iview locale matters
|
|
|
- new webpack.IgnorePlugin(/^\.\/locale$/, /moment|iview$/)
|
|
|
- ]
|
|
|
+ plugins
|
|
|
}
|
|
|
};
|