From c7fe028db4a98ef48f9b5ffd07fcc13d49f5e3b1 Mon Sep 17 00:00:00 2001 From: silverwind Date: Wed, 22 Jan 2020 07:35:29 +0100 Subject: [PATCH] misc webpack tweaks (#9924) - reduce verbosity during build - use array form `use` to allow easier extension - disable uninteresting source maps - disable symlink resolution for a speedup Co-authored-by: zeripath Co-authored-by: techknowlogick --- Makefile | 2 +- webpack.config.js | 51 +++++++++++++++++++++++++++-------------------- 2 files changed, 30 insertions(+), 23 deletions(-) diff --git a/Makefile b/Makefile index a47a803ab..71d9828e2 100644 --- a/Makefile +++ b/Makefile @@ -479,7 +479,7 @@ js: node-check fomantic $(JS_DEST) $(JS_DEST): node_modules $(JS_SOURCES) npx eslint web_src/js webpack.config.js - npx webpack + npx webpack --hide-modules --display-entrypoints=false .PHONY: fomantic fomantic: node-check $(FOMANTIC_DEST_DIR) diff --git a/webpack.config.js b/webpack.config.js index a56b37c84..b4b034d61 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -38,29 +38,31 @@ module.exports = { { test: /\.js$/, exclude: /node_modules/, - use: { - loader: 'babel-loader', - options: { - presets: [ - [ - '@babel/preset-env', - { - useBuiltIns: 'usage', - corejs: 3, - } - ] - ], - plugins: [ - [ - '@babel/plugin-transform-runtime', - { - regenerator: true, - } + use: [ + { + loader: 'babel-loader', + options: { + presets: [ + [ + '@babel/preset-env', + { + useBuiltIns: 'usage', + corejs: 3, + } + ] ], - '@babel/plugin-proposal-object-rest-spread', - ], - } - } + plugins: [ + [ + '@babel/plugin-transform-runtime', + { + regenerator: true, + } + ], + '@babel/plugin-proposal-object-rest-spread', + ], + } + }, + ], }, { test: /\.css$/i, @@ -73,6 +75,8 @@ module.exports = { new SourceMapDevToolPlugin({ filename: '[name].js.map', exclude: [ + 'gitgraph.js', + 'jquery.js', 'swagger.js', ], }), @@ -84,4 +88,7 @@ module.exports = { return !filename.endsWith('.map') && filename !== 'swagger.js'; } }, + resolve: { + symlinks: false, + } };