mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 19:06:18 +01:00 
			
		
		
		
	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>
This commit is contained in:
		| @@ -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, | ||||
|   } | ||||
| }; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user