You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tell the server where to serve the content from. This is only necessary if you want to serve static files. [static.publicPath](#publicpath) will be used to determine where the bundles should be served from, and takes precedence.
1153
+
Tell the server where to serve the content from. This is only necessary if you want to serve static files. [`static.publicPath`](#publicpath) will be used to determine where the bundles should be served from, and takes precedence.
1116
1154
1117
1155
**webpack.config.js**
1118
1156
@@ -1133,7 +1171,7 @@ T> It is recommended to use an absolute path.
1133
1171
1134
1172
### staticOptions
1135
1173
1136
-
It is possible to configure advanced options for serving static files from [static.directory](#directory). See the [Express documentation](http://expressjs.com/en/4x/api.html#express.static) for the possible options.
1174
+
It is possible to configure advanced options for serving static files from [`static.directory`](#directory). See the [Express documentation](http://expressjs.com/en/4x/api.html#express.static) for the possible options.
Tell dev-server to watch the files served by the [static.directory]($directory) option. It is disabled by default. When enabled, file changes will trigger a full page reload.
1277
+
Tell dev-server to watch the files served by the [`static.directory`]($directory) option. It is disabled by default. When enabled, file changes will trigger a full page reload.
1240
1278
1241
1279
**webpack.config.js**
1242
1280
@@ -1266,7 +1304,7 @@ To disable:
1266
1304
npx webpack serve --no-static-watch
1267
1305
```
1268
1306
1269
-
It is possible to configure advanced options for watching static files from [static.directory](#directory). See the [chokidar](https://github.com/paulmillr/chokidar) documentation for the possible options.
1307
+
It is possible to configure advanced options for watching static files from [`static.directory`](#directory). See the [`chokidar`](https://github.com/paulmillr/chokidar) documentation for the possible options.
1270
1308
1271
1309
```javascript
1272
1310
constpath=require('path');
@@ -1287,6 +1325,35 @@ module.exports = {
1287
1325
1288
1326
## devServer.watchFiles
1289
1327
1328
+
`string``[string]``object``[object]`
1329
+
1330
+
This option allows you to configure list of globs/directories/files to watch for file changes. For example:
1331
+
1332
+
```javascript
1333
+
module.exports= {
1334
+
//...
1335
+
devServer: {
1336
+
watchFiles: ['src/**/*.php', 'public/**/*'],
1337
+
},
1338
+
};
1339
+
```
1340
+
1341
+
It is possible to configure advanced options for watching files. See the [`chokidar`](https://github.com/paulmillr/chokidar) documentation for the possible options.
0 commit comments