TypeError: CleanwebpackPlugin is not a constructor

前端 未结 10 2125
感动是毒
感动是毒 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 09:08

    With the update you'll need to do the following to include it

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

    Then in the array of plugins replace add the following

    plugins: [
         new CleanWebpackPlugin(['dist]),
    ]
    

    with

    plugins: [
         new CleanWebpackPlugin(),
    ]
    

    As the with the update there is no need to pass any parameters as it will remove all files inside webpack's output.path directory, as well as all unused webpack assets after every successful rebuild.

提交回复
热议问题