'Vue-cli webpack dev server doesnt ignore selected files
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?
Solution 1:[1]
Type regex expression in devServer.static.watch.ignored instead string
ignored: /.*\.html/
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Qba |
