如何在vue应用程序的webpack配置中排除生产版本中的文件

时间:2020-05-07 08:57:35

标签: javascript vue.js web webpack webpack-4

我尝试从产品版本中排除HTML文件“ dev.html”。我必须如何配置Webpack? 我知道我必须应用规则,但是在哪里?这是我的vue.config.js

module.exports = {
  "transpileDependencies": [
    "vuetify"
  ],


  pages: {
    index: {
      // entry for the page
      entry: 'src/main.ts',
      // the source template
      template: process.env.NODE_ENV === 'development' ?
        'public/dev.html' :
        'public/index.html',
      // output as dist/index.html
      filename: 'index.html',
      // when using title option,
      // template title tag needs to be <title><%= htmlWebpackPlugin.options.title %></title>
      title: 'Index Page',
      // chunks to include on this page, by default includes
      // extracted common chunks and vendor chunks.
      chunks: ['chunk-vendors', 'chunk-common', 'index']
    },
  },
  configureWebpack: {
    devtool: process.env.NODE_ENV === 'development' ? 'source-map' : 'none',

  }
}

0 个答案:

没有答案