mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-25 11:22:16 +00:00
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
This commit is contained in:
parent
4b5ebb93e4
commit
3621944c2d
10 changed files with 5309 additions and 3823 deletions
|
@ -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,
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue