jeudi 7 mai 2020

How to exclude files in production build in the webpack config of my vue application

I try to exclude an Html-file "dev.html" from the product build. How do I have to configure the webpack? I know I have to apply rules, but where? This is my 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',

  }
}



Aucun commentaire:

Enregistrer un commentaire