Skip to content

Documentation example seems wrong #114

Closed
@SetTrend

Description

@SetTrend

Issue description or question

The sample code in readme.md reads (comments removed for brevity):

const CleanWebpackPlugin = require('clean-webpack-plugin');

const webpackConfig = {
    plugins: [
        new CleanWebpackPlugin(),
    ],
};

module.exports = webpackConfig;

I, however, have to write:

Webpack Config

const cleanWP = require('clean-webpack-plugin').default;

module.exports = {
  plugins: [
    new cleanWP()
  ]
};

... for Visual Studio Code (and the TypeScript compiler) to correctly construct clean-webpack-plugin.

Please note the additional .default in the first line.

Shouldn't this additionally required .default be mentioned in the readme.md file?

Environment

Run: npx envinfo --system --binaries --npmPackages clean-webpack-plugin,webpack

 System:
    OS: Windows 10
    CPU: (8) x64 Intel(R) Xeon(R) Gold 6142 CPU @ 2.60GHz
    Memory: 11.00 GB / 16.00 GB
  Binaries:
    Node: 10.15.3 - C:\Program Files\nodejs\node.EXE
    npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions