Fix webpack config to work with installed webpack version
This commit is contained in:
parent
6978121a7d
commit
230d5ceab2
|
@ -1,4 +1,3 @@
|
||||||
const path = require('path')
|
|
||||||
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||||
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin')
|
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin')
|
||||||
const webpack = require('webpack')
|
const webpack = require('webpack')
|
||||||
|
@ -14,7 +13,6 @@ module.exports = (env) => {
|
||||||
entry: './src/index.tsx',
|
entry: './src/index.tsx',
|
||||||
output: {
|
output: {
|
||||||
filename: 'index.[fullhash].js',
|
filename: 'index.[fullhash].js',
|
||||||
path: path.join(__dirname, 'dist'),
|
|
||||||
publicPath: "/",
|
publicPath: "/",
|
||||||
},
|
},
|
||||||
devtool: 'source-map',
|
devtool: 'source-map',
|
||||||
|
@ -52,11 +50,11 @@ module.exports = (env) => {
|
||||||
},
|
},
|
||||||
optimization: {
|
optimization: {
|
||||||
minimizer: [
|
minimizer: [
|
||||||
new ESBuildMinifyPlugin({
|
new ESBuildMinifyPlugin({
|
||||||
target: 'es2018',
|
target: 'es2018',
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
new ForkTsCheckerWebpackPlugin(),
|
new ForkTsCheckerWebpackPlugin(),
|
||||||
new HtmlWebpackPlugin({
|
new HtmlWebpackPlugin({
|
||||||
|
@ -73,10 +71,14 @@ module.exports = (env) => {
|
||||||
devServer: {
|
devServer: {
|
||||||
historyApiFallback: true,
|
historyApiFallback: true,
|
||||||
host: '0.0.0.0',
|
host: '0.0.0.0',
|
||||||
stats: 'errors-only',
|
|
||||||
overlay: true,
|
|
||||||
hot: true,
|
hot: true,
|
||||||
|
client: {
|
||||||
|
overlay: true,
|
||||||
|
},
|
||||||
|
devMiddleware: {
|
||||||
|
stats: 'errors-only',
|
||||||
|
}
|
||||||
},
|
},
|
||||||
stats: 'minimal'
|
stats: 'minimal'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue