1

I`m trying to ignore all *.html files so that webpack devserver wont reload when the files changes.

My config looks like this

const path = require('path');

module.exports = {
    pages:
    {
        index: 
        {
            entry: 'src/main.js',
            template: 'public/Index.html'
        }
    },
    outputDir: "wwwroot",
    filenameHashing: true,
    configureWebpack: 
    {
        devServer: {
            static: {
                directory: path.join(__dirname, 'public'),
                watch: 
                {
                    ignored: '*.html',
                    usePolling: false,
                }
            },
        },
        watchOptions: 
        {
            aggregateTimeout: 3000,
            ignored: /.*\.html/
        }
    }
}

I`m using @vue/cli-service: 5.0.4 which uses webpack 5. And it doesnt work, when I change html file webpack dev-server still reloads page. How I can make it work so changing html pages will not reload page?

Qba
  • 148
  • 1
  • 7
  • 25

1 Answers1

0

Type regex expression in devServer.static.watch.ignored instead string

ignored: /.*\.html/
Qba
  • 148
  • 1
  • 7
  • 25