Fix webpack config to work with installed webpack version

This commit is contained in:
Franck 2022-01-03 12:15:00 +11:00
parent 6978121a7d
commit 230d5ceab2
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
1 changed files with 11 additions and 9 deletions

View File

@ -1,4 +1,3 @@
const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin')
const webpack = require('webpack')
@ -14,7 +13,6 @@ module.exports = (env) => {
entry: './src/index.tsx',
output: {
filename: 'index.[fullhash].js',
path: path.join(__dirname, 'dist'),
publicPath: "/",
},
devtool: 'source-map',
@ -52,11 +50,11 @@ module.exports = (env) => {
},
optimization: {
minimizer: [
new ESBuildMinifyPlugin({
target: 'es2018',
}),
new ESBuildMinifyPlugin({
target: 'es2018',
}),
],
},
},
plugins: [
new ForkTsCheckerWebpackPlugin(),
new HtmlWebpackPlugin({
@ -73,10 +71,14 @@ module.exports = (env) => {
devServer: {
historyApiFallback: true,
host: '0.0.0.0',
stats: 'errors-only',
overlay: true,
hot: true,
client: {
overlay: true,
},
devMiddleware: {
stats: 'errors-only',
}
},
stats: 'minimal'
}
}
}