Swap out babel-minify for terser (#2885)

This commit is contained in:
Paulus Schoutsen
2019-03-05 13:10:35 -08:00
committed by GitHub
parent daaaef96b0
commit 1c6235546a
7 changed files with 49 additions and 332 deletions
+3 -11
View File
@@ -7,6 +7,7 @@ const isProd = process.env.NODE_ENV === "production";
const chunkFilename = isProd ? "chunk.[chunkhash].js" : "[name].chunk.js";
const buildPath = path.resolve(__dirname, "dist");
const publicPath = isProd ? "./" : "http://localhost:8080/";
const latestBuild = true;
module.exports = {
mode: isProd ? "production" : "development",
@@ -16,7 +17,7 @@ module.exports = {
entry: "./src/entrypoint.js",
module: {
rules: [
babelLoaderConfig({ latestBuild: true }),
babelLoaderConfig({ latestBuild }),
{
test: /\.css$/,
use: "raw-loader",
@@ -32,7 +33,7 @@ module.exports = {
},
],
},
optimization: webpackBase.optimization,
optimization: webpackBase.optimization(latestBuild),
plugins: [
new CopyWebpackPlugin([
"public",
@@ -51,15 +52,6 @@ module.exports = {
to: "static/images/leaflet/",
},
]),
isProd &&
new UglifyJsPlugin({
extractComments: true,
sourceMap: true,
uglifyOptions: {
// Disabling because it broke output
mangle: false,
},
}),
].filter(Boolean),
resolve: webpackBase.resolve,
output: {