TypeError: CleanwebpackPlugin is not a constructor

前端 未结 10 2099
感动是毒
感动是毒 2021-01-01 08:39

i\'m trying to preview a vue web application through webpack-server-dev.I\'m following this guide https://medium.com/the-web-tub/creating-your-first-vue-js-pwa-project-22f7

10条回答
  •  失恋的感觉
    2021-01-01 08:46

    The correct one is to use this import:

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

    And then instead of passing an array with the distribution folder, change it to

    plugins: [
         new CleanWebpackPlugin(),
         //...
    ]
    

提交回复
热议问题