安装clean-webpack-plugin后打包报错

1、安装clean-webpack-plugin后打包报错 

 

 

2、经查证,clean-webpack-plugin引入方法改为了

  const {CleanWebpackPlugin} = require('clean-webpack-plugin')  
  plugins: [ //插件的数组
    new CleanWebpackPlugin() 
    new htmlWebpackPlugin({ //创建一个把html首页托管到内存中的插件
      template: path.join(__dirname, './src/index.html'), //把哪个html页面,托管到内存中去
      filename: 'index.html' //指定将来在内存中复制出来的页面,名称叫做 什么 ,一般默认为index.html
     }),        
  ]

 

posted @ 2020-10-14 09:39  迷雾幻空  阅读(300)  评论(0)    收藏  举报