mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 15:57:13 +00:00
Merge pull request #32595 from davecardwell/webpack-dev-server-writeToDisk
[webpack-dev-server] Add writeToDisk configuration
This commit is contained in:
Vendored
+3
@@ -5,6 +5,7 @@
|
||||
// Zheyang Song <https://github.com/ZheyangSong>
|
||||
// Alan Agius <https://github.com/alan-agius4>
|
||||
// Artur Androsovych <https://github.com/arturovt>
|
||||
// Dave Cardwell <https://github.com/davecardwell>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -165,6 +166,8 @@ declare namespace WebpackDevServer {
|
||||
watchContentBase?: boolean;
|
||||
/** Control options related to watching the files. */
|
||||
watchOptions?: webpack.WatchOptions;
|
||||
/** Tells devServer to write generated assets to the disk. */
|
||||
writeToDisk?: boolean | ((filePath: string) => boolean);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -72,6 +72,7 @@ const config: WebpackDevServer.Configuration = {
|
||||
aggregateTimeout: 300,
|
||||
poll: 1000
|
||||
},
|
||||
writeToDisk: true,
|
||||
// It's a required option.
|
||||
publicPath: "/assets/",
|
||||
headers: { "X-Custom-Header": "yes" }
|
||||
@@ -83,6 +84,9 @@ const c2: WebpackDevServer.Configuration = {
|
||||
const c3: WebpackDevServer.Configuration = {
|
||||
stats: "verbose",
|
||||
};
|
||||
const c4: WebpackDevServer.Configuration = {
|
||||
writeToDisk: (filePath: string) => true,
|
||||
};
|
||||
|
||||
// API example
|
||||
server = new WebpackDevServer(compiler, config);
|
||||
|
||||
Reference in New Issue
Block a user