fingerpan / vue-cli-plugin-dll

Vue CLI 3 plugin for Webpack DllPlugin/DllReferencePlugin
MIT License
76 stars 22 forks source link

删除注释如何配置? #43

Open pangxieju opened 4 years ago

pangxieju commented 4 years ago

vue.config.js 的里删除注释配置对生成的 dll 文件无效,请问 dll 插件如可添加删除注释功能。

fingerpan commented 4 years ago

vue.config.js 的里删除注释配置对生成的 dll 文件无效,请问 dll 插件如可添加删除注释功能。

你是如何配置的?

pangxieju commented 4 years ago

vue.config.js的里删除注释配置对生成的dll文件无效,请问dll插件如可添加删除注释功能。

你是如何配置的?

在 vue.config.js 文件里面配置

{
  pluginOptions: {
    dll: {
      entry: ['vue', 'vue-router'],
    },
  },
  configureWebpack: (config) => {
    config.optimization = {
      minimizer: [
        // https://webpack.js.org/plugins/terser-webpack-plugin/
        new TerserPlugin({
          extractComments: false,
          terserOptions: {
            compress: {
              drop_console: true,
              drop_debugger: true,
              pure_funcs: ['console.log'],
            },
          },
          cache: isCache,
        }),
      ],
    };
  }
}