aboutsummaryrefslogtreecommitdiffstats
path: root/webpack.config.js
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2020-01-22 07:35:29 +0100
committerLunny Xiao <xiaolunwen@gmail.com>2020-01-22 14:35:29 +0800
commitc7fe028db4a98ef48f9b5ffd07fcc13d49f5e3b1 (patch)
tree08c68931c5561f6c62a34d03810ff2f51a870b11 /webpack.config.js
parent81daf26878d8a7e14c172fc39fc55c36281b1898 (diff)
downloadgitea-c7fe028db4a98ef48f9b5ffd07fcc13d49f5e3b1.tar.gz
gitea-c7fe028db4a98ef48f9b5ffd07fcc13d49f5e3b1.zip
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 <art27@cantab.net> Co-authored-by: techknowlogick <matti@mdranta.net>
Diffstat (limited to 'webpack.config.js')
-rw-r--r--webpack.config.js51
1 files changed, 29 insertions, 22 deletions
diff --git a/webpack.config.js b/webpack.config.js
index a56b37c845..b4b034d615 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,
+ }
};