关于webpack使用清除插件出现 TypeError: CleanWebpackPlugin is not a constructor

在新版本webpack4.使用清除插件出现问题:

由于现在新版本的 clean-webpack-plugin 插件引入已经改为const CleanWebpackPlugin require('clean-webpack-plugin');

所以使用webpack中文网上的例子时会报错;

原写法:

更改后写法:

这里不用指向dist ;效果一样;

猜你喜欢

转载自www.cnblogs.com/gushiyoyo/p/11139733.html
今日推荐