From 15ac143cb16285bab2fb10c3b42b74041703af22 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Sun, 22 Nov 2020 12:11:12 +0100 Subject: [PATCH] webpack: Drop unnecessary output settings The default of `path` and `sourceMapFilename` are already what we want, no need to set them explicitly. The `output.filename` is already `[name].js`, and it's totally not important to name the file differently in production mode (it will then just be `index.js.gz`, compared to index.js in development mode). --- webpack.config.js | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index 386ea37..28723ce 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -12,7 +12,6 @@ var externals = { /* These can be overridden, typically from the Makefile.am */ const srcdir = (process.env.SRCDIR || __dirname) + path.sep + "src"; const builddir = (process.env.SRCDIR || __dirname); -const distdir = builddir + path.sep + "dist"; const section = process.env.ONLYDIR || null; const nodedir = path.resolve((process.env.SRCDIR || __dirname), "node_modules"); @@ -31,12 +30,6 @@ var info = { ], }; -var output = { - path: distdir, - filename: "[name].js", - sourceMapFilename: "[file].map", -}; - /* * Note that we're avoiding the use of path.join as webpack and nodejs * want relative paths that start with ./ explicitly. @@ -84,9 +77,6 @@ var plugins = [ /* Only minimize when in production mode */ if (production) { - /* Rename output files when minimizing */ - output.filename = "[name].min.js"; - plugins.unshift(new CompressionPlugin({ test: /\.(js|html)$/, minRatio: 0.9, @@ -126,7 +116,6 @@ module.exports = { }, entry: info.entries, externals: externals, - output: output, devtool: "source-map", module: { rules: [