Search code examples
javascriptwebpackphpstorm

PhpStorm highlights output option "clean" as invalid option in webpack config


PhpStorm shows me following tooltip text on specifiying clean: true in my webpack.config.js.

webpack: Property 'clean' is not allowed
Inspection info: Validates options in the webpack configuration file (which name should start with webpack, e.g. webpack.config.js) against webpack Options Schema.

Disable this inspection to turn off validation and code completions inside the configuration object.

Disabling is no option for me ;-)

I inspected the options schema and found the property 'clean'. As far as i understand the schema, it should be correct.

Here my webpack.config.js:

const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');

module.exports = {
    entry: './src/app.js',
    output: {
        clean: true,
        filename: 'index.js',
        path: path.resolve(__dirname, 'dist'),
    },
    mode: "development",
    plugins: [
        new HtmlWebpackPlugin({
            title: 'Output Management',
        }),
    ],
};

Versions: Webpack: 5.24.3 PhpStorm: 2020.3.2

What am i doing wrong here?


Solution

  • The bundled webpack schema needs to be updates, please vote for WEB-49925 to be notified on any progress with it