From 13b7da6d0a42b0296c733f88a16b505c52015b0c Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Wed, 20 Oct 2021 22:56:39 +0200 Subject: [PATCH] fix initial creation of lockfile --- .gitignore | 1 + lib/schemes/HttpUriPlugin.js | 1 + .../http-url/dev-defaults.webpack.lock | 18 ------------------ .../asset-modules/http-url/test.config.js | 15 +++++++++++++++ 4 files changed, 17 insertions(+), 18 deletions(-) delete mode 100644 test/configCases/asset-modules/http-url/dev-defaults.webpack.lock create mode 100644 test/configCases/asset-modules/http-url/test.config.js diff --git a/.gitignore b/.gitignore index 5236a9877..ed9bd295d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ /test/fixtures/temp-* /test/temp /test/ChangesAndRemovals +/test/**/dev-defaults.webpack.lock /benchmark/js /benchmark/fixtures /examples/**/dist diff --git a/lib/schemes/HttpUriPlugin.js b/lib/schemes/HttpUriPlugin.js index ea4d005be..36c35a3fb 100644 --- a/lib/schemes/HttpUriPlugin.js +++ b/lib/schemes/HttpUriPlugin.js @@ -1044,6 +1044,7 @@ Run build with un-frozen lockfile to automatically fix lockfile.` inProgressWrite.push(runWrite); } else { inProgressWrite = []; + runWrite(); } } ); diff --git a/test/configCases/asset-modules/http-url/dev-defaults.webpack.lock b/test/configCases/asset-modules/http-url/dev-defaults.webpack.lock deleted file mode 100644 index 3ced737c1..000000000 --- a/test/configCases/asset-modules/http-url/dev-defaults.webpack.lock +++ /dev/null @@ -1,18 +0,0 @@ -{ - "http://localhost:9990/asset.txt": { "integrity": "sha512-LHT9F+2v2A6ER7DUZ0HuJDt+t03SFJoKsbkkb7MDgvJ+hT2FhXGeDmfL2g2qj1FnEGRhXWRa4nrLFb+xRH9Fmw==", "contentType": "text/css" }, - "http://localhost:9990/asset.txt?query": { "integrity": "sha512-LHT9F+2v2A6ER7DUZ0HuJDt+t03SFJoKsbkkb7MDgvJ+hT2FhXGeDmfL2g2qj1FnEGRhXWRa4nrLFb+xRH9Fmw==", "contentType": "text/css" }, - "http://localhost:9990/fallback.js": { "integrity": "sha512-BCkBS4Wb0EreudEceuobqZZwTE7SeVUJ2vVHxDQKm8xW6dGJRcUrrSWcjd/61zijOeYAW0P+boOg7u0vxrGwYg==", "contentType": "text/javascript" }, - "http://localhost:9990/folder/dependency.js": { "integrity": "sha512-N0En4W3aNPY82MPu16+50P4PqLLyPLI6l33wR2a3ue8VCRjY8RJl8erRB8ztWSEYNad7yRDPrqlYT+IBtoOA9w==", "contentType": "text/javascript" }, - "http://localhost:9990/folder/sub-dependency.js": { "integrity": "sha512-Jjmwazwmg67EwNPViCBwvSIxhENfS6gwufXoQLrB0B/JDA4v1p+p2S5Y6IGP4SzZqqVTsROlU8meD6ep3q6MTA==", "contentType": "text/javascript" }, - "http://localhost:9990/folder/sub-dependency2.js": { "integrity": "sha512-BDZKEwlnwBabeHEwmMd02NxFEjYy+QwKAKP0S8zMMesX7dUsvh11hM7LUOPPFOS+nIEFZPtnc7kFwmnojVUw5A==", "contentType": "text/javascript" }, - "http://localhost:9990/index.css?cache": { "integrity": "sha512-sqhF9JAEi5h3ziP48SBnzQnaeei8cf/pfYJBdKL4F7xdu3v5yr71eQ0kCL11/jWRFjLG4TKOudUnS/u6WLMqYw==", "contentType": "text/css" }, - "http://localhost:9990/index.css?no-cache": "no-cache", - "http://localhost:9990/index.css?query#fragment": { "integrity": "sha512-sqhF9JAEi5h3ziP48SBnzQnaeei8cf/pfYJBdKL4F7xdu3v5yr71eQ0kCL11/jWRFjLG4TKOudUnS/u6WLMqYw==", "contentType": "text/css" }, - "http://localhost:9990/redirect": { "resolved": "http://localhost:9990/redirect.js", "integrity": "sha512-BV/MK/QTq+NHRve1XpZyQ8V6cjRP/fwbtJvENRdm5C73qNYZ4i2/fw+soj7J4qxzBXMHDbvOnA6E0ShnX2hc1w==", "contentType": "text/javascript" }, - "http://localhost:9990/redirect.js": { "integrity": "sha512-BV/MK/QTq+NHRve1XpZyQ8V6cjRP/fwbtJvENRdm5C73qNYZ4i2/fw+soj7J4qxzBXMHDbvOnA6E0ShnX2hc1w==", "contentType": "text/javascript" }, - "http://localhost:9990/resolve.js": { "integrity": "sha512-6J9zBO2hXSMTO1EtXJOxSRB2nVPHCoNmNHS8an1QeehzJFc3uoBPRWu6hqHPc54gv2/QME9RBR/BXIan68virg==", "contentType": "text/javascript" }, - "http://localhost:9990/url.js": { "integrity": "sha512-Dlw99Gtp/ZRxWvGlqD2EKnvbo1i6j/slwQO4WV8RIRhYZx9ErI+rndpyDMaKykSnq20HCp5H73TJ+dtO+wDyEg==", "contentType": "text/javascript" }, - "https://raw.githubusercontent.com//webpack//webpack//main/CODE_OF_CONDUCT.md": { "resolved": "https://raw.githubusercontent.com/webpack/webpack/main/CODE_OF_CONDUCT.md", "integrity": "sha512-OLJ9q6iSO652hVBkTLsMLtQnFBBTzEbFqLGyWD62nPga/0DZ9bc3oOFb5OYT8RIPzmlOX4WzK2uiLgc1NSGtBA==", "contentType": "text/plain; charset=utf-8" }, - "https://raw.githubusercontent.com/webpack/webpack/main/CODE_OF_CONDUCT.md": { "integrity": "sha512-OLJ9q6iSO652hVBkTLsMLtQnFBBTzEbFqLGyWD62nPga/0DZ9bc3oOFb5OYT8RIPzmlOX4WzK2uiLgc1NSGtBA==", "contentType": "text/plain; charset=utf-8" }, - "version": 1 -} diff --git a/test/configCases/asset-modules/http-url/test.config.js b/test/configCases/asset-modules/http-url/test.config.js new file mode 100644 index 000000000..b515d7d0e --- /dev/null +++ b/test/configCases/asset-modules/http-url/test.config.js @@ -0,0 +1,15 @@ +const fs = require("fs"); +const path = require("path"); + +module.exports = { + beforeExecute() { + try { + fs.unlinkSync(path.join(__dirname, "dev-defaults.webpack.lock")); + } catch (e) {} + }, + afterExecute() { + try { + fs.unlinkSync(path.join(__dirname, "dev-defaults.webpack.lock")); + } catch (e) {} + } +};