mirror of https://github.com/webpack/webpack.git
allow to disable compareBeforeEmit
This commit is contained in:
parent
019e35bf26
commit
07671f3481
|
|
@ -1180,6 +1180,10 @@ export interface OutputOptions {
|
||||||
* Number of milliseconds before chunk request expires
|
* Number of milliseconds before chunk request expires
|
||||||
*/
|
*/
|
||||||
chunkLoadTimeout?: number;
|
chunkLoadTimeout?: number;
|
||||||
|
/**
|
||||||
|
* Check if to be emitted file already exists and have the same content before writing to output filesystem
|
||||||
|
*/
|
||||||
|
compareBeforeEmit?: boolean;
|
||||||
/**
|
/**
|
||||||
* This option enables cross-origin loading of chunks.
|
* This option enables cross-origin loading of chunks.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -581,6 +581,7 @@ class Compiler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.options.output.compareBeforeEmit) {
|
||||||
this.outputFileSystem.stat(targetPath, (err, stats) => {
|
this.outputFileSystem.stat(targetPath, (err, stats) => {
|
||||||
const exists = !err && stats.isFile();
|
const exists = !err && stats.isFile();
|
||||||
|
|
||||||
|
|
@ -590,6 +591,9 @@ class Compiler {
|
||||||
processMissingFile();
|
processMissingFile();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
processMissingFile();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (targetFile.match(/\/|\\/)) {
|
if (targetFile.match(/\/|\\/)) {
|
||||||
|
|
|
||||||
|
|
@ -232,6 +232,7 @@ class WebpackOptionsDefaulter extends OptionsDefaulter {
|
||||||
this.set("output.webassemblyModuleFilename", "[hash].module.wasm");
|
this.set("output.webassemblyModuleFilename", "[hash].module.wasm");
|
||||||
this.set("output.library", "");
|
this.set("output.library", "");
|
||||||
this.set("output.publicPath", "");
|
this.set("output.publicPath", "");
|
||||||
|
this.set("output.compareBeforeEmit", true);
|
||||||
this.set("output.hotUpdateFunction", "make", options => {
|
this.set("output.hotUpdateFunction", "make", options => {
|
||||||
return Template.toIdentifier(
|
return Template.toIdentifier(
|
||||||
"webpackHotUpdate" + Template.toIdentifier(options.output.library)
|
"webpackHotUpdate" + Template.toIdentifier(options.output.library)
|
||||||
|
|
|
||||||
|
|
@ -1123,6 +1123,10 @@
|
||||||
"description": "Number of milliseconds before chunk request expires",
|
"description": "Number of milliseconds before chunk request expires",
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
|
"compareBeforeEmit": {
|
||||||
|
"description": "Check if to be emitted file already exists and have the same content before writing to output filesystem",
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
"crossOriginLoading": {
|
"crossOriginLoading": {
|
||||||
"description": "This option enables cross-origin loading of chunks.",
|
"description": "This option enables cross-origin loading of chunks.",
|
||||||
"enum": [false, "anonymous", "use-credentials"]
|
"enum": [false, "anonymous", "use-credentials"]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue