Не запускаеться webpackserver
Когда запускаю npx webpack server иле npx run start вылезает такая ошибка, хотя всё верно написанно
[webpack-cli] Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.
- options has an unknown property 'contentBase'. These properties are valid:
object { allowedHosts?, bonjour?, client?, compress?, devMiddleware?, headers?, historyApiFallback?, host?, hot?, http2?, https?, ipc?, liveReload?, magicHtml?, onAfterSetupMiddleware?, onBeforeSetupMiddleware?, onListening?, open?, port?, proxy?, server?, setupExitSignals?, setupMiddlewares?, static?, watchFiles?, webSocketServer? }
npm ERR! code 2
npm ERR! path /home/sumichan/SPAonts
npm ERR! command failed
npm ERR! command sh -c webpack "serve"
так же код из файла webpack.config.js
const HtmlWebpackPlugin = require('html-webpack-plugin');
require('webpack');
const path = require('path');
module.exports = {
entry: './src/index.ts',
mode: 'development',
devServer: {
contentBase: path.join(__dirname, 'dist'),
compress: true,
port: 8080,
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js',
},
module: {
rules: [
{ test: /\.txt$/, use: 'raw-loader' },
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/
},
{
test: /\.css$/i,
use: [
{
loader: 'style-loader',
options: { injectType: 'singletonStyleTag' },
},
'css-loader',
],
},
],
},
plugins: [new HtmlWebpackPlugin({ template: './src/index.html' })],
resolve: {
extensions: [ ".tsx", ".ts", ".js" ]
},
};