Pass js through babel and eslint

This commit is contained in:
Jonny Barnes 2020-11-27 15:22:54 +00:00
parent fb9e230914
commit 42340828bf
7 changed files with 3407 additions and 0 deletions

14
webpack.config.js vendored
View file

@ -3,6 +3,7 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const StyleLintPlugin = require('stylelint-webpack-plugin');
const CompressionPlugin = require('compression-webpack-plugin');
const zlib = require('zlib');
const EslintPlugin = require('eslint-webpack-plugin');
module.exports = {
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
@ -34,6 +35,15 @@ module.exports = {
}
}
]
}, {
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env']
}
}
}]
},
plugins: [
@ -46,6 +56,10 @@ module.exports = {
context: path.resolve(__dirname + '/resources/css'),
files: '**/*.css',
}),
new EslintPlugin({
context: path.resolve(__dirname + '/resources/js'),
files: '**/*.js',
}),
new CompressionPlugin({
filename: "[path][base].br",
algorithm: "brotliCompress",