Skip to content

Commit c7fe028

Browse files
silverwindzeripathtechknowlogick
authored andcommitted
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 <[email protected]> Co-authored-by: techknowlogick <[email protected]>
1 parent 81daf26 commit c7fe028

File tree

2 files changed

+30
-23
lines changed

2 files changed

+30
-23
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ js: node-check fomantic $(JS_DEST)
479479

480480
$(JS_DEST): node_modules $(JS_SOURCES)
481481
npx eslint web_src/js webpack.config.js
482-
npx webpack
482+
npx webpack --hide-modules --display-entrypoints=false
483483

484484
.PHONY: fomantic
485485
fomantic: node-check $(FOMANTIC_DEST_DIR)

webpack.config.js

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -38,29 +38,31 @@ module.exports = {
3838
{
3939
test: /\.js$/,
4040
exclude: /node_modules/,
41-
use: {
42-
loader: 'babel-loader',
43-
options: {
44-
presets: [
45-
[
46-
'@babel/preset-env',
47-
{
48-
useBuiltIns: 'usage',
49-
corejs: 3,
50-
}
51-
]
52-
],
53-
plugins: [
54-
[
55-
'@babel/plugin-transform-runtime',
56-
{
57-
regenerator: true,
58-
}
41+
use: [
42+
{
43+
loader: 'babel-loader',
44+
options: {
45+
presets: [
46+
[
47+
'@babel/preset-env',
48+
{
49+
useBuiltIns: 'usage',
50+
corejs: 3,
51+
}
52+
]
5953
],
60-
'@babel/plugin-proposal-object-rest-spread',
61-
],
62-
}
63-
}
54+
plugins: [
55+
[
56+
'@babel/plugin-transform-runtime',
57+
{
58+
regenerator: true,
59+
}
60+
],
61+
'@babel/plugin-proposal-object-rest-spread',
62+
],
63+
}
64+
},
65+
],
6466
},
6567
{
6668
test: /\.css$/i,
@@ -73,6 +75,8 @@ module.exports = {
7375
new SourceMapDevToolPlugin({
7476
filename: '[name].js.map',
7577
exclude: [
78+
'gitgraph.js',
79+
'jquery.js',
7680
'swagger.js',
7781
],
7882
}),
@@ -84,4 +88,7 @@ module.exports = {
8488
return !filename.endsWith('.map') && filename !== 'swagger.js';
8589
}
8690
},
91+
resolve: {
92+
symlinks: false,
93+
}
8794
};

0 commit comments

Comments
 (0)