Code
I have a public folder like this
public/
├── assets
│ ├── image.png
│ ├── video.mp4
├── css
│ └── style.css
└── index.html
And my config like this
devServer: {
publicPath: '/',
contentBase: './public/',
watchContentBase: true,
// don't watch node_modules
watchOptions: {
ignored: /node_modules/,
},
},
Actual Behavior
Right now the watchContentBase acts only on the root folder, because of this chokidar options:
Expected Behavior
I would like for watchContentBase: true, to trigger a reload whenever a file in my public folder changes.
It was also discussed in #1227, but I don't this is a good solution to start another chokidar instance. Plus this is a really common use-case.
It would be really useful to have an option recursive: true in the watchOptions: {}, or more simply a depth: undefined option which goes to override the default chokidar options.
I am willing to make a PR if we decide what direction to take.
Operating System: OSX
Node Version: v11.7.0
NPM Version: 6.5.0
webpack Version: 4.29.5
webpack-dev-server Version: 3.2.1
This is a bug
This is a modification request
Code
I have a public folder like this
And my config like this
Actual Behavior
Right now the
watchContentBaseacts only on the root folder, because of this chokidar options:webpack-dev-server/lib/Server.js
Line 943 in cb10f83
Expected Behavior
I would like for
watchContentBase: true,to trigger a reload whenever a file in my public folder changes.It was also discussed in #1227, but I don't this is a good solution to start another chokidar instance. Plus this is a really common use-case.
It would be really useful to have an option
recursive: truein thewatchOptions: {}, or more simply adepth: undefinedoption which goes to override the default chokidar options.I am willing to make a PR if we decide what direction to take.