summaryrefslogtreecommitdiffstats
path: root/webpack.config.js
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2019-11-14 22:39:51 +0100
committerzeripath <art27@cantab.net>2019-11-14 22:39:51 +0100
commit3621944c2d381d159cf2622328927cf282f0b3e0 (patch)
tree17c4b38f851fae79c0084ce47a425b39f99f56c7 /webpack.config.js
parentNew review approvals shouldn't require a message (#8991) (diff)
downloadforgejo-3621944c2d381d159cf2622328927cf282f0b3e0.tar.xz
forgejo-3621944c2d381d159cf2622328927cf282f0b3e0.zip
modernize js and use babel (#8973)
* modernize js and use babel - add babel toolchain to transform modern JS to ES5 - extend eslint config for modern rules - fixes linting issues via `eslint --fix` and manual fixes * run 'make css' to satisfy CI * code style tweaks and set js indendation to 2 in .editorconfig * regenerate js
Diffstat (limited to 'webpack.config.js')
-rw-r--r--webpack.config.js30
1 files changed, 26 insertions, 4 deletions
diff --git a/webpack.config.js b/webpack.config.js
index 750ee4c89a..8749e93914 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -9,12 +9,34 @@ module.exports = {
devtool: 'source-map',
output: {
path: path.resolve(__dirname, 'public/js'),
- filename: "[name].js"
+ filename: '[name].js'
},
optimization: {
minimize: true,
- minimizer: [new TerserPlugin({
- sourceMap: true
- })],
+ minimizer: [new TerserPlugin({
+ sourceMap: true,
+ })],
},
+ module: {
+ rules: [
+ {
+ test: /\.js$/,
+ exclude: /node_modules/,
+ use: {
+ loader: 'babel-loader',
+ options: {
+ presets: [
+ [
+ '@babel/preset-env',
+ {
+ useBuiltIns: 'entry',
+ corejs: 3,
+ }
+ ]
+ ]
+ }
+ }
+ }
+ ]
+ }
};