[webpack]解决报错 CleanWebpackPlugin is not a constructor
错误写法
const CleanWebpackPlugin = require("clean-webpack-plugin");
正确写法:
let {CleanWebpackPlugin} = require('clean-webpack-plugin');
新版本的 clean-webpack-plugin 要通过构造函数取到包内的 CleanWebpackPlugin 方法
错误写法
const CleanWebpackPlugin = require("clean-webpack-plugin");
正确写法:
let {CleanWebpackPlugin} = require('clean-webpack-plugin');
新版本的 clean-webpack-plugin 要通过构造函数取到包内的 CleanWebpackPlugin 方法