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
Copy file name to clipboardExpand all lines: src/content/configuration/dev-server.md
+33Lines changed: 33 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1226,3 +1226,36 @@ module.exports = {
1226
1226
If this is too heavy on the file system, you can change this to an integer to set the interval in milliseconds.
1227
1227
1228
1228
See [WatchOptions](/configuration/watch/) for more options.
1229
+
1230
+
1231
+
## `devServer.writeToDisk` 🔑
1232
+
1233
+
`boolean: false``function (filePath)`
1234
+
1235
+
Tells `devServer` to write generated assets to the disk.
1236
+
1237
+
__webpack.config.js__
1238
+
1239
+
```javascript
1240
+
module.exports= {
1241
+
//...
1242
+
devServer: {
1243
+
writeToDisk:true
1244
+
}
1245
+
};
1246
+
```
1247
+
1248
+
Providing a `Function` to `devServer.writeToDisk` can be used for filtering. The function follows the same premise as [`Array#filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) in which a boolean return value tells if the file should be written to disk.
0 commit comments