I am using webpack - v5.90.3, webpack-cli - v5.1.4, webpack-dev-server - v5.0.2
In my webpack.config.dev.js:
const path = require('path');
const webpack = require('webpack');
module.exports = {
mode: 'development',
devtool: 'cheap-module-source-map',
devServer: {
static: path.join(__dirname, 'public/'),
devMiddleware: {
publicPath: '/dist/'
},
port: 3000,
hot: "only"
},
entry: [
require.resolve('react-dev-utils/webpackHotDevClient'),
paths.appIndexJs,
],
output: {
path: paths.appBuild,
pathinfo: true,
filename: 'SHSADCAA/static/js/bundle.js',
chunkFilename: 'SHSADCAA/static/js/[name].chunk.js',
publicPath: publicPath,
devtoolModuleFilenameTemplate: info =>
path.resolve(info.absoluteResourcePath).replace(/\\/g, '/'),
},
optimization: {
splitChunks: {
chunks: 'all',
name: false,
},
runtimeChunk: true,
},
resolve: {
process.env.NODE_PATH.split(path.delimiter).filter(Boolean)
),
'react-native': 'react-native-web',
},
plugins: [
PnpWebpackPlugin,
new ModuleScopePlugin(paths.appSrc, [paths.appPackageJson]),
],
},
resolveLoader: {
plugins: [
PnpWebpackPlugin.moduleLoader(module),
],
},
I got this error:
Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.
- options has an unknown property '_assetEmittingPreviousFiles'. These properties are valid: object { allowedHosts?, bonjour?, client?, compress?, devMiddleware?, headers?, historyApiFallback?, host?, hot?, ipc?, liveReload?, onListening?, open?, port?, proxy?, server?, setupExitSignals?, setupMiddlewares?, static?, watchFiles?, webSocketServer? }
I'm trying to migrate from v3 to v5, but I'm still stuck on this one.