Skip to content

Commit

Permalink
add fsStartTime for single runs
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed May 21, 2021
1 parent ad1c802 commit fbcc470
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions lib/node/NodeEnvironmentPlugin.js
Expand Up @@ -50,6 +50,7 @@ class NodeEnvironmentPlugin {
);
compiler.hooks.beforeRun.tap("NodeEnvironmentPlugin", compiler => {
if (compiler.inputFileSystem === inputFileSystem) {
compiler.fsStartTime = Date.now();
inputFileSystem.purge();
}
});
Expand Down
9 changes: 4 additions & 5 deletions test/configCases/asset-modules/file-url/webpack.config.js
@@ -1,12 +1,10 @@
const fs = require("fs");
const path = require("path");
const { pathToFileURL } = require("url");
const file = path.resolve(
"./test/configCases/asset-modules/file-url",
"./temp/index.js"
);
const dir = path.resolve(__dirname, "temp");
const file = path.resolve(dir, "index.js");

fs.mkdirSync("./test/configCases/asset-modules/file-url/temp", {
fs.mkdirSync(dir, {
recursive: true
});
fs.writeFileSync(
Expand All @@ -31,6 +29,7 @@ import v2 from ${JSON.stringify(
export const val1 = v1;
export const val2 = v2;`
);
fs.utimesSync(file, new Date(Date.now() - 10000), new Date(Date.now() - 10000));

/** @type {import("../../../../").Configuration} */
module.exports = {
Expand Down

0 comments on commit fbcc470

Please sign in to comment.