Delete or not create a file for each entry in webpack

前端 未结 3 1845
时光说笑
时光说笑 2020-12-31 19:11

Hi I have a webpack config with these entry points:

  entry: {
    \'polyfills\': \'./src/polyfills.ts\',
    \'vendor\':    \'./src/vendor.ts\',
    \'app         


        
3条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-31 19:28

    You can delete any files or folders after compilation by using remove-files-webpack-plugin.

    Use this plugin like this:

    plugins: [
      new RemovePlugin({
        after: {
          // expects what your output folder is `dist`.
          include: [
            './dist/css.bundle.js',
            './dist/css.map'
          ]
        }
      })
    ]
    

    Note: i'm the creator of this plugin.

提交回复
热议问题