webpack. Ошибка при запуске
webpack.config.js:
const path = require('path');
module.exports = {
entry: './src/script.js',
output: {
mode: 'development',
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist')
}
};
Пишу - npx webpack --config webpack.config.js
Ошибка:
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration.output has an unknown property 'mode'. These properties are valid:
object { auxiliaryComment?, chunkCallbackName?, chunkFilename?, chunkLoadTimeout?, crossOriginLoading?, devtoolFallbackModuleFilenameTemplate?, devtoolLineToLine?, devtoolModuleFilenameTemplate?, devtoolNamespace?, filename?, futureEmitAssets?, globalObject?, hashDigest?, hashDigestLength?, hashFunction?, hashSalt?, hotUpdateChunkFilename?, hotUpdateFunction?, hotUpdateMainFilename?, jsonpFunction?, jsonpScriptType?, library?, libraryExport?, libraryTarget?, path?, pathinfo?, publicPath?, sourceMapFilename?, sourcePrefix?, strictModuleExceptionHandling?, umdNamedDefine?, webassemblyModuleFilename? }
-> Options affecting the output of the compilation. output options tell webpack how to write the compiled files to disk.