Error: clean-webpack-plugin only accepts an options object.
TypeError: CleanWebpackPlugin is not a constructor
More than two errors belong to the same
Prior written like this:
const CleanWebpackPlugin = require("clean-webpack-plugin"); plugins:[ new CleanWebpackPlugin(['dist']), ]
Then error: TypeError: CleanWebpackPlugin is not a constructor
Later wrote:
const {CleanWebpackPlugin} = require("clean-webpack-plugin"); plugins:[ new CleanWebpackPlugin(['dist']), ]
Continue error: Error: clean-webpack-plugin only accepts an options object.
Finally, write:
const {CleanWebpackPlugin} = require("clean-webpack-plugin"); plugins:[ new CleanWebpackPlugin(), ]
Successful operation ~
Two:
1, new CleanWebpackPlugin () in not write parameters,
2, need {}