diff --git a/packages/rspack/tests/configCases/loader/options/a.js b/packages/rspack/tests/configCases/loader/options/a.js
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/packages/rspack/tests/configCases/loader/options/b.js b/packages/rspack/tests/configCases/loader/options/b.js
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/packages/rspack/tests/configCases/loader/options/c.js b/packages/rspack/tests/configCases/loader/options/c.js
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/packages/rspack/tests/configCases/loader/options/d.js b/packages/rspack/tests/configCases/loader/options/d.js
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/packages/rspack/tests/configCases/loader/options/e.js b/packages/rspack/tests/configCases/loader/options/e.js
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/packages/rspack/tests/configCases/loader/options/error1.js b/packages/rspack/tests/configCases/loader/options/error1.js
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/packages/rspack/tests/configCases/loader/options/error2.js b/packages/rspack/tests/configCases/loader/options/error2.js
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/packages/rspack/tests/configCases/loader/options/f.js b/packages/rspack/tests/configCases/loader/options/f.js
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/packages/rspack/tests/configCases/loader/options/g.js b/packages/rspack/tests/configCases/loader/options/g.js
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/packages/rspack/tests/configCases/loader/options/h.js b/packages/rspack/tests/configCases/loader/options/h.js
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/packages/rspack/tests/configCases/loader/options/i.js b/packages/rspack/tests/configCases/loader/options/i.js
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/packages/rspack/tests/configCases/loader/options/index.js b/packages/rspack/tests/configCases/loader/options/index.js
new file mode 100644
index 00000000000..66eca065d4e
--- /dev/null
+++ b/packages/rspack/tests/configCases/loader/options/index.js
@@ -0,0 +1,45 @@
+it("should get options", function () {
+ expect(require("./a")).toStrictEqual({
+ arg: true,
+ arg1: null,
+ arg3: 1234567890,
+ arg4: "string",
+ arg5: [1, 2, 3],
+ arg6: { foo: "value", bar: { baz: "other-value" } }
+ });
+ expect(require("./b")).toStrictEqual({
+ arg: true,
+ arg1: null,
+ arg3: 1234567890,
+ arg4: "string",
+ arg5: [1, 2, 3],
+ arg6: { foo: "value", bar: { baz: "other-value" } }
+ });
+ expect(require("./c")).toStrictEqual({
+ arg: true,
+ arg1: null,
+ arg3: 1234567890,
+ arg4: "string",
+ arg5: [1, 2, 3],
+ arg6: { foo: "value", bar: { baz: "other-value" } }
+ });
+ expect(require("./d")).toStrictEqual({
+ arg4: "text"
+ });
+ expect(require("./e")).toStrictEqual({});
+ expect(require("./f")).toStrictEqual({
+ delicious: "",
+ name: "cheesecake",
+ slices: "8",
+ warm: "false"
+ });
+ expect(require("./g")).toStrictEqual({
+ "=": "="
+ });
+ expect(require("./h")).toStrictEqual({
+ foo: "bar"
+ });
+ expect(require("./i")).toStrictEqual({
+ foo: "bar"
+ });
+});
diff --git a/packages/rspack/tests/configCases/loader/options/infrastructure-log.js b/packages/rspack/tests/configCases/loader/options/infrastructure-log.js
new file mode 100644
index 00000000000..47af2b051a6
--- /dev/null
+++ b/packages/rspack/tests/configCases/loader/options/infrastructure-log.js
@@ -0,0 +1,3 @@
+module.exports = [
+ /^Pack got invalid because of write to: Compilation\/modules.+loaders[/\\]options[/\\]error1\.js$/
+];
diff --git a/packages/rspack/tests/configCases/loader/options/loader-1.js b/packages/rspack/tests/configCases/loader/options/loader-1.js
new file mode 100644
index 00000000000..4614a709d80
--- /dev/null
+++ b/packages/rspack/tests/configCases/loader/options/loader-1.js
@@ -0,0 +1,12 @@
+const schema = require("./loader-1.options.json");
+
+/** @type {import("@rspack/core").LoaderDefinition} */
+module.exports = function () {
+ const options = this.getOptions(schema);
+
+ const json = JSON.stringify(options)
+ .replace(/\u2028/g, "\\u2028")
+ .replace(/\u2029/g, "\\u2029");
+
+ return `module.exports = ${json}`;
+};
diff --git a/packages/rspack/tests/configCases/loader/options/loader-1.options.json b/packages/rspack/tests/configCases/loader/options/loader-1.options.json
new file mode 100644
index 00000000000..3c86ba01025
--- /dev/null
+++ b/packages/rspack/tests/configCases/loader/options/loader-1.options.json
@@ -0,0 +1,43 @@
+{
+ "additionalProperties": false,
+ "properties": {
+ "arg": {
+ "type": "boolean"
+ },
+ "arg1": {
+ "type": "null"
+ },
+ "arg2": {},
+ "arg3": {
+ "type": "number"
+ },
+ "arg4": {
+ "type": "string"
+ },
+ "arg5": {
+ "type": "array",
+ "items": {
+ "type": "number"
+ }
+ },
+ "arg6": {
+ "type": "object",
+ "properties": {
+ "foo": {
+ "type": "string"
+ },
+ "bar": {
+ "type": "object",
+ "properties": {
+ "baz": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "type": "object"
+}
diff --git a/packages/rspack/tests/configCases/loader/options/loader-2.js b/packages/rspack/tests/configCases/loader/options/loader-2.js
new file mode 100644
index 00000000000..c645b12a668
--- /dev/null
+++ b/packages/rspack/tests/configCases/loader/options/loader-2.js
@@ -0,0 +1,12 @@
+const schema = require("./loader-2.options.json");
+
+/** @type {import("@rspack/core").LoaderDefinition} */
+module.exports = function () {
+ const options = this.getOptions(schema);
+
+ const json = JSON.stringify(options)
+ .replace(/\u2028/g, "\\u2028")
+ .replace(/\u2029/g, "\\u2029");
+
+ return `module.exports = ${json}`;
+};
diff --git a/packages/rspack/tests/configCases/loader/options/loader-2.options.json b/packages/rspack/tests/configCases/loader/options/loader-2.options.json
new file mode 100644
index 00000000000..d17814f5fcf
--- /dev/null
+++ b/packages/rspack/tests/configCases/loader/options/loader-2.options.json
@@ -0,0 +1,10 @@
+{
+ "title": "Custom Loader Name configuration",
+ "additionalProperties": false,
+ "properties": {
+ "arg": {
+ "enum": [true]
+ }
+ },
+ "type": "object"
+}
diff --git a/packages/rspack/tests/configCases/loader/options/loader.js b/packages/rspack/tests/configCases/loader/options/loader.js
new file mode 100644
index 00000000000..95ce29ab040
--- /dev/null
+++ b/packages/rspack/tests/configCases/loader/options/loader.js
@@ -0,0 +1,10 @@
+/** @type {import("@rspack/core").LoaderDefinition} */
+module.exports = function () {
+ const options = this.getOptions();
+
+ const json = JSON.stringify(options)
+ .replace(/\u2028/g, "\\u2028")
+ .replace(/\u2029/g, "\\u2029");
+
+ return `module.exports = ${json}`;
+};
diff --git a/packages/rspack/tests/configCases/loader/options/webpack.config.js b/packages/rspack/tests/configCases/loader/options/webpack.config.js
new file mode 100644
index 00000000000..56d11578126
--- /dev/null
+++ b/packages/rspack/tests/configCases/loader/options/webpack.config.js
@@ -0,0 +1,93 @@
+/** @type {import("@rspack/core").Configuration} */
+module.exports = {
+ mode: "none",
+ module: {
+ rules: [
+ {
+ test: /a\.js$/,
+ loader: "./loader",
+ options: {
+ arg: true,
+ arg1: null,
+ arg2: undefined,
+ arg3: 1234567890,
+ arg4: "string",
+ arg5: [1, 2, 3],
+ arg6: { foo: "value", bar: { baz: "other-value" } }
+ }
+ },
+ {
+ test: /b\.js$/,
+ loader: "./loader-1",
+ options: {
+ arg: true,
+ arg1: null,
+ arg2: undefined,
+ arg3: 1234567890,
+ arg4: "string",
+ arg5: [1, 2, 3],
+ arg6: { foo: "value", bar: { baz: "other-value" } }
+ }
+ },
+ {
+ test: /c\.js$/,
+ loader: "./loader-1",
+ options: JSON.stringify({
+ arg: true,
+ arg1: null,
+ arg2: undefined,
+ arg3: 1234567890,
+ arg4: "string",
+ arg5: [1, 2, 3],
+ arg6: { foo: "value", bar: { baz: "other-value" } }
+ })
+ },
+ {
+ test: /d\.js$/,
+ loader: "./loader-1",
+ options: "arg4=text"
+ },
+ {
+ test: /d\.js$/,
+ loader: "./loader",
+ options: ""
+ },
+ {
+ test: /f\.js$/,
+ loader: "./loader",
+ options: "name=cheesecake&slices=8&delicious&warm=false"
+ },
+ {
+ test: /g\.js$/,
+ loader: "./loader",
+ options: "%3d=%3D"
+ },
+ {
+ test: /h\.js$/,
+ loader: "./loader",
+ options: "foo=bar"
+ },
+ {
+ test: /i\.js$/,
+ loader: "./loader",
+ options: `${JSON.stringify({
+ foo: "bar"
+ })}`
+ },
+ {
+ test: /error1\.js$/,
+ loader: "./loader-1",
+ options: {
+ arg6: { foo: "value", bar: { baz: 42 } }
+ }
+ },
+ {
+ test: /error2\.js$/,
+ loader: "./loader-2",
+ options: {
+ arg: false
+ }
+ }
+ ]
+ }
+};
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index fa247e4e401..20fa90df9f0 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1293,8 +1293,8 @@ importers:
babel-plugin-import: ^1.13.5
browserslist: ^4.21.3
chokidar: 3.5.3
- coffee-loader: ^4.0.0
- coffeescript: ^2.7.0
+ coffee-loader: ^1.0.0
+ coffeescript: ^2.5.1
copy-webpack-plugin: '5'
csv-to-markdown-table: ^1.3.0
enhanced-resolve: 5.12.0
@@ -1352,7 +1352,7 @@ importers:
babel-loader: 9.1.2
babel-plugin-import: 1.13.5
chokidar: 3.5.3
- coffee-loader: 4.0.0_coffeescript@2.7.0
+ coffee-loader: 1.0.1_coffeescript@2.7.0
coffeescript: 2.7.0
copy-webpack-plugin: 5.1.2
csv-to-markdown-table: 1.3.0
@@ -13516,6 +13516,7 @@ packages:
dependencies:
webpack: 5.76.0_webpack-cli@4.10.0
webpack-cli: 4.10.0_webpack@5.76.0
+ dev: true
/@webpack-cli/info/1.5.0_webpack-cli@4.10.0:
resolution: {integrity: sha512-e8tSXZpw2hPl2uMJY6fsMswaok5FdlGNRTktvFk2sD8RjH0hE2+XistawJx1vmKteh4NmGmNUrp+Tb2w+udPcQ==}
@@ -13524,6 +13525,7 @@ packages:
dependencies:
envinfo: 7.8.1
webpack-cli: 4.10.0_webpack@5.76.0
+ dev: true
/@webpack-cli/serve/1.7.0_webpack-cli@4.10.0:
resolution: {integrity: sha512-oxnCNGj88fL+xzV+dacXs44HcDwf1ovs3AuEzvP7mqXw7fQntqIhQ1BRmynh4qEKQSSSRSWVyXRjmTbZIX9V2Q==}
@@ -13535,6 +13537,7 @@ packages:
optional: true
dependencies:
webpack-cli: 4.10.0_webpack@5.76.0
+ dev: true
/@xtuc/ieee754/1.2.0:
resolution: {integrity: sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==}
@@ -15491,6 +15494,7 @@ packages:
is-plain-object: 2.0.4
kind-of: 6.0.3
shallow-clone: 3.0.1
+ dev: true
/clone-response/1.0.2:
resolution: {integrity: sha512-yjLXh88P599UOyPTFX0POsd7WxnbsVsGohcwzHOLspIhhpalPw1BcqED8NblyZLKcGrL8dTgMlcaZxV2jAD41Q==}
@@ -15519,14 +15523,16 @@ packages:
engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'}
dev: true
- /coffee-loader/4.0.0_coffeescript@2.7.0:
- resolution: {integrity: sha512-RvgC8c0JwRew5lq3x2J+P4z9Cvan/v91muEvV90VJXcTuJbJQN20taZxfj6/XC4yysA8PInPGpxdB1J9LphLuQ==}
- engines: {node: '>= 14.15.0'}
+ /coffee-loader/1.0.1_coffeescript@2.7.0:
+ resolution: {integrity: sha512-l3lcWeyNE11ZXNYEpkIkerrvBdSpT06/kcR7MyY+0ys38MOuqzhr+s+s7Tsvv2QH1+qEmhvG8mGuUWIO2zH7Bg==}
+ engines: {node: '>= 10.13.0'}
peerDependencies:
coffeescript: '>= 2.0.0'
- webpack: ^5.0.0
+ webpack: ^4.0.0 || ^5.0.0
dependencies:
coffeescript: 2.7.0
+ loader-utils: 2.0.4
+ schema-utils: 3.1.2
dev: true
/coffeescript/2.7.0:
@@ -17280,6 +17286,7 @@ packages:
resolution: {integrity: sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==}
engines: {node: '>=4'}
hasBin: true
+ dev: true
/err-code/2.0.3:
resolution: {integrity: sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==}
@@ -18015,6 +18022,7 @@ packages:
/fastest-levenshtein/1.0.16:
resolution: {integrity: sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==}
engines: {node: '>= 4.9.1'}
+ dev: true
/fastq/1.13.0:
resolution: {integrity: sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==}
@@ -19660,6 +19668,7 @@ packages:
dependencies:
pkg-dir: 4.2.0
resolve-cwd: 3.0.0
+ dev: true
/imurmurhash/0.1.4:
resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==}
@@ -19797,6 +19806,7 @@ packages:
/interpret/2.2.0:
resolution: {integrity: sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==}
engines: {node: '>= 0.10'}
+ dev: true
/interpret/3.1.1:
resolution: {integrity: sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==}
@@ -20158,6 +20168,7 @@ packages:
engines: {node: '>=0.10.0'}
dependencies:
isobject: 3.0.1
+ dev: true
/is-plain-object/5.0.0:
resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==}
@@ -20348,6 +20359,7 @@ packages:
/isobject/3.0.1:
resolution: {integrity: sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==}
engines: {node: '>=0.10.0'}
+ dev: true
/isomorphic-fetch/2.2.1:
resolution: {integrity: sha512-9c4TNAKYXM5PRyVcwUZrF3W09nQ+sO7+jydgs4ZGW9dhsLG2VOlISJABombdQqQRXCwuYG3sYV/puGf5rp0qmA==}
@@ -21257,6 +21269,7 @@ packages:
/kind-of/6.0.3:
resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==}
engines: {node: '>=0.10.0'}
+ dev: true
/kleur/3.0.3:
resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==}
@@ -25308,6 +25321,7 @@ packages:
engines: {node: '>= 0.10'}
dependencies:
resolve: 1.22.2
+ dev: true
/rechoir/0.8.0:
resolution: {integrity: sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==}
@@ -25594,6 +25608,7 @@ packages:
engines: {node: '>=8'}
dependencies:
resolve-from: 5.0.0
+ dev: true
/resolve-from/4.0.0:
resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==}
@@ -25602,6 +25617,7 @@ packages:
/resolve-from/5.0.0:
resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==}
engines: {node: '>=8'}
+ dev: true
/resolve-pathname/3.0.0:
resolution: {integrity: sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==}
@@ -26305,6 +26321,7 @@ packages:
engines: {node: '>=8'}
dependencies:
kind-of: 6.0.3
+ dev: true
/shallowequal/1.1.0:
resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==}
@@ -27845,7 +27862,7 @@ packages:
schema-utils: 3.1.2
serialize-javascript: 6.0.1
terser: 5.17.1
- webpack: 5.76.0_webpack-cli@4.10.0
+ webpack: 5.76.0
/terser/5.16.1:
resolution: {integrity: sha512-xvQfyfA1ayT0qdK47zskQgRZeWLoOQ8JQ6mIgRGVNwZKdQMU+5FkCBjmv4QjcrTzyZquRw2FVtlJSRUmMKQslw==}
@@ -29301,6 +29318,7 @@ packages:
rechoir: 0.7.1
webpack: 5.76.0_webpack-cli@4.10.0
webpack-merge: 5.9.0
+ dev: true
/webpack-dev-middleware/5.3.3:
resolution: {integrity: sha512-hj5CYrY0bZLB+eTO+x/j67Pkrquiy7kWepMHmUMoPsmcUaeEnQJqFzHJOyxgWlq746/wUuA64p9ta34Kyb01pA==}
@@ -29575,6 +29593,7 @@ packages:
dependencies:
clone-deep: 4.0.1
wildcard: 2.0.0
+ dev: true
/webpack-sources/2.3.1:
resolution: {integrity: sha512-y9EI9AO42JjEcrTJFOYmVywVZdKVUfOvDUPsJea5GIr1JOEGFVqwlY2K098fFoIjOkDzHn2AjRvM8dsBZu+gCA==}
@@ -29689,6 +29708,7 @@ packages:
- '@swc/core'
- esbuild
- uglify-js
+ dev: true
/webpack/5.80.0_esbuild@0.17.18:
resolution: {integrity: sha512-OIMiq37XK1rWO8mH9ssfFKZsXg4n6klTEDL7S8/HqbAOBBaiy8ABvXvz0dDCXeEF9gqwxSvVk611zFPjS8hJxA==}
@@ -29856,6 +29876,7 @@ packages:
/wildcard/2.0.0:
resolution: {integrity: sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==}
+ dev: true
/window-size/0.1.0:
resolution: {integrity: sha512-1pTPQDKTdd61ozlKGNCjhNRd+KPmgLSGa3mZTHoOliaGcESD8G1PXhh7c1fgiPjVbNVfgy2Faw4BI8/m0cC8Mg==}
diff --git a/webpack-test/cases/large/many-replacements/test.filter.js b/webpack-test/cases/large/many-replacements/test.filter.js
index 1ae95bcd901..71a71e594ff 100644
--- a/webpack-test/cases/large/many-replacements/test.filter.js
+++ b/webpack-test/cases/large/many-replacements/test.filter.js
@@ -1,10 +1,3 @@
-
-/*
module.exports = function (config) {
return !process.env.CI;
};
-
-*/
-module.exports = () => {return "https://github.com/web-infra-dev/rspack/issues/4396"}
-
-
\ No newline at end of file
diff --git a/webpack-test/cases/loaders/coffee-loader/test.filter.js b/webpack-test/cases/loaders/coffee-loader/test.filter.js
deleted file mode 100644
index 8b5c6c57288..00000000000
--- a/webpack-test/cases/loaders/coffee-loader/test.filter.js
+++ /dev/null
@@ -1,3 +0,0 @@
-
-module.exports = () => {return "https://github.com/web-infra-dev/rspack/issues/4396"}
-
diff --git a/webpack-test/configCases/loaders/options/deprecations.js b/webpack-test/configCases/loaders/options/deprecations.js
index 8a666cac60f..6c3c0c2f1b2 100644
--- a/webpack-test/configCases/loaders/options/deprecations.js
+++ b/webpack-test/configCases/loaders/options/deprecations.js
@@ -1,9 +1,9 @@
module.exports = [
- // { code: /DEP_WEBPACK_RULE_LOADER_OPTIONS_STRING/ },
- // { code: /DEP_WEBPACK_RULE_LOADER_OPTIONS_STRING/ },
- // { code: /DEP_WEBPACK_RULE_LOADER_OPTIONS_STRING/ },
- // { code: /DEP_WEBPACK_RULE_LOADER_OPTIONS_STRING/ },
- // { code: /DEP_WEBPACK_RULE_LOADER_OPTIONS_STRING/ },
- // { code: /DEP_WEBPACK_RULE_LOADER_OPTIONS_STRING/ },
- // { code: /DEP_WEBPACK_RULE_LOADER_OPTIONS_STRING/ }
+ { code: /DEP_WEBPACK_RULE_LOADER_OPTIONS_STRING/ },
+ { code: /DEP_WEBPACK_RULE_LOADER_OPTIONS_STRING/ },
+ { code: /DEP_WEBPACK_RULE_LOADER_OPTIONS_STRING/ },
+ { code: /DEP_WEBPACK_RULE_LOADER_OPTIONS_STRING/ },
+ { code: /DEP_WEBPACK_RULE_LOADER_OPTIONS_STRING/ },
+ { code: /DEP_WEBPACK_RULE_LOADER_OPTIONS_STRING/ },
+ { code: /DEP_WEBPACK_RULE_LOADER_OPTIONS_STRING/ }
];
diff --git a/webpack-test/configCases/loaders/options/errors.js b/webpack-test/configCases/loaders/options/errors.js
index e6af6e70b2f..3ea73741041 100644
--- a/webpack-test/configCases/loaders/options/errors.js
+++ b/webpack-test/configCases/loaders/options/errors.js
@@ -1,12 +1,12 @@
module.exports = [
- // [
- // /\.\/loader-1\.js/,
- // /Loader has been/,
- // /options\.arg6\.bar\.baz should be a string/
- // ],
- // [
- // /\.\/loader-2\.js/,
- // /Custom Loader Name has been/,
- // /configuration\.arg should be true/
- // ]
+ [
+ /\.\/loader-1\.js/,
+ /Loader has been/,
+ /options\.arg6\.bar\.baz should be a string/
+ ],
+ [
+ /\.\/loader-2\.js/,
+ /Custom Loader Name has been/,
+ /configuration\.arg should be true/
+ ]
];
diff --git a/webpack-test/configCases/loaders/options/index.js b/webpack-test/configCases/loaders/options/index.js
index 33cc2cdea1e..56896b7c2ef 100644
--- a/webpack-test/configCases/loaders/options/index.js
+++ b/webpack-test/configCases/loaders/options/index.js
@@ -44,8 +44,8 @@ it("should get options", function() {
});
});
-// const never = false;
-// if (never) {
-// require("./error1");
-// require("./error2");
-// }
+const never = false;
+if (never) {
+ require("./error1");
+ require("./error2");
+}
diff --git a/webpack-test/configCases/loaders/options/test.filter.js b/webpack-test/configCases/loaders/options/test.filter.js
new file mode 100644
index 00000000000..98e4afe7608
--- /dev/null
+++ b/webpack-test/configCases/loaders/options/test.filter.js
@@ -0,0 +1 @@
+module.exports = () => {return false}
diff --git a/webpack-test/package.json b/webpack-test/package.json
index 38c2c6d0a58..ba8e551fa72 100644
--- a/webpack-test/package.json
+++ b/webpack-test/package.json
@@ -27,8 +27,8 @@
"babel-loader": "^9.1.0",
"babel-plugin-import": "^1.13.5",
"chokidar": "3.5.3",
- "coffee-loader": "^4.0.0",
- "coffeescript": "^2.7.0",
+ "coffee-loader": "^1.0.0",
+ "coffeescript": "^2.5.1",
"copy-webpack-plugin": "5",
"csv-to-markdown-table": "^1.3.0",
"file-loader": "^6.2.0",
diff --git a/webpack-test/packages/rspack/node_modules/make-dir/index.d.ts b/webpack-test/packages/rspack/node_modules/make-dir/index.d.ts
new file mode 100644
index 00000000000..3e1529c6210
--- /dev/null
+++ b/webpack-test/packages/rspack/node_modules/make-dir/index.d.ts
@@ -0,0 +1,39 @@
+///
+import * as fs from 'fs';
+
+export interface Options {
+ /**
+ * Directory [permissions](https://x-team.com/blog/file-system-permissions-umask-node-js/).
+ *
+ * @default 0o777 & (~process.umask())
+ */
+ readonly mode?: number;
+
+ /**
+ * Use a custom `fs` implementation. For example [`graceful-fs`](https://github.com/isaacs/node-graceful-fs).
+ *
+ * Using a custom `fs` implementation will block the use of the native `recursive` option if `fs.mkdir` or `fs.mkdirSync` is not the native function.
+ *
+ * @default require('fs')
+ */
+ readonly fs?: typeof fs;
+}
+
+/**
+ * Make a directory and its parents if needed - Think `mkdir -p`.
+ *
+ * @param path - Directory to create.
+ * @returns A `Promise` for the path to the created directory.
+ */
+export default function makeDir(
+ path: string,
+ options?: Options
+): Promise;
+
+/**
+ * Synchronously make a directory and its parents if needed - Think `mkdir -p`.
+ *
+ * @param path - Directory to create.
+ * @returns The path to the created directory.
+ */
+export function sync(path: string, options?: Options): string;
diff --git a/webpack-test/packages/rspack/node_modules/make-dir/index.js b/webpack-test/packages/rspack/node_modules/make-dir/index.js
new file mode 100644
index 00000000000..4d95c916405
--- /dev/null
+++ b/webpack-test/packages/rspack/node_modules/make-dir/index.js
@@ -0,0 +1,139 @@
+'use strict';
+const fs = require('fs');
+const path = require('path');
+const pify = require('pify');
+const semver = require('semver');
+
+const defaults = {
+ mode: 0o777 & (~process.umask()),
+ fs
+};
+
+const useNativeRecursiveOption = semver.satisfies(process.version, '>=10.12.0');
+
+// https://github.com/nodejs/node/issues/8987
+// https://github.com/libuv/libuv/pull/1088
+const checkPath = pth => {
+ if (process.platform === 'win32') {
+ const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, ''));
+
+ if (pathHasInvalidWinCharacters) {
+ const error = new Error(`Path contains invalid characters: ${pth}`);
+ error.code = 'EINVAL';
+ throw error;
+ }
+ }
+};
+
+const permissionError = pth => {
+ // This replicates the exception of `fs.mkdir` with native the
+ // `recusive` option when run on an invalid drive under Windows.
+ const error = new Error(`operation not permitted, mkdir '${pth}'`);
+ error.code = 'EPERM';
+ error.errno = -4048;
+ error.path = pth;
+ error.syscall = 'mkdir';
+ return error;
+};
+
+const makeDir = (input, options) => Promise.resolve().then(() => {
+ checkPath(input);
+ options = Object.assign({}, defaults, options);
+
+ // TODO: Use util.promisify when targeting Node.js 8
+ const mkdir = pify(options.fs.mkdir);
+ const stat = pify(options.fs.stat);
+
+ if (useNativeRecursiveOption && options.fs.mkdir === fs.mkdir) {
+ const pth = path.resolve(input);
+
+ return mkdir(pth, {
+ mode: options.mode,
+ recursive: true
+ }).then(() => pth);
+ }
+
+ const make = pth => {
+ return mkdir(pth, options.mode)
+ .then(() => pth)
+ .catch(error => {
+ if (error.code === 'EPERM') {
+ throw error;
+ }
+
+ if (error.code === 'ENOENT') {
+ if (path.dirname(pth) === pth) {
+ throw permissionError(pth);
+ }
+
+ if (error.message.includes('null bytes')) {
+ throw error;
+ }
+
+ return make(path.dirname(pth)).then(() => make(pth));
+ }
+
+ return stat(pth)
+ .then(stats => stats.isDirectory() ? pth : Promise.reject())
+ .catch(() => {
+ throw error;
+ });
+ });
+ };
+
+ return make(path.resolve(input));
+});
+
+module.exports = makeDir;
+module.exports.default = makeDir;
+
+module.exports.sync = (input, options) => {
+ checkPath(input);
+ options = Object.assign({}, defaults, options);
+
+ if (useNativeRecursiveOption && options.fs.mkdirSync === fs.mkdirSync) {
+ const pth = path.resolve(input);
+
+ fs.mkdirSync(pth, {
+ mode: options.mode,
+ recursive: true
+ });
+
+ return pth;
+ }
+
+ const make = pth => {
+ try {
+ options.fs.mkdirSync(pth, options.mode);
+ } catch (error) {
+ if (error.code === 'EPERM') {
+ throw error;
+ }
+
+ if (error.code === 'ENOENT') {
+ if (path.dirname(pth) === pth) {
+ throw permissionError(pth);
+ }
+
+ if (error.message.includes('null bytes')) {
+ throw error;
+ }
+
+ make(path.dirname(pth));
+ return make(pth);
+ }
+
+ try {
+ if (!options.fs.statSync(pth).isDirectory()) {
+ throw new Error('The path is not a directory');
+ }
+ } catch (_) {
+ throw error;
+ }
+ }
+
+ return pth;
+ };
+
+ return make(path.resolve(input));
+};
diff --git a/webpack-test/packages/rspack/node_modules/make-dir/license b/webpack-test/packages/rspack/node_modules/make-dir/license
new file mode 100644
index 00000000000..e7af2f77107
--- /dev/null
+++ b/webpack-test/packages/rspack/node_modules/make-dir/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/webpack-test/packages/rspack/node_modules/make-dir/package.json b/webpack-test/packages/rspack/node_modules/make-dir/package.json
new file mode 100644
index 00000000000..1b51bf70f72
--- /dev/null
+++ b/webpack-test/packages/rspack/node_modules/make-dir/package.json
@@ -0,0 +1,59 @@
+{
+ "name": "make-dir",
+ "version": "2.1.0",
+ "description": "Make a directory and its parents if needed - Think `mkdir -p`",
+ "license": "MIT",
+ "repository": "sindresorhus/make-dir",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=6"
+ },
+ "scripts": {
+ "test": "xo && nyc ava && tsd-check"
+ },
+ "files": [
+ "index.js",
+ "index.d.ts"
+ ],
+ "keywords": [
+ "mkdir",
+ "mkdirp",
+ "make",
+ "directories",
+ "dir",
+ "dirs",
+ "folders",
+ "directory",
+ "folder",
+ "path",
+ "parent",
+ "parents",
+ "intermediate",
+ "recursively",
+ "recursive",
+ "create",
+ "fs",
+ "filesystem",
+ "file-system"
+ ],
+ "dependencies": {
+ "pify": "^4.0.1",
+ "semver": "^5.6.0"
+ },
+ "devDependencies": {
+ "@types/graceful-fs": "^4.1.3",
+ "@types/node": "^11.10.4",
+ "ava": "^1.2.0",
+ "codecov": "^3.0.0",
+ "graceful-fs": "^4.1.11",
+ "nyc": "^13.1.0",
+ "path-type": "^3.0.0",
+ "tempy": "^0.2.1",
+ "tsd-check": "^0.3.0",
+ "xo": "^0.24.0"
+ }
+}
diff --git a/webpack-test/packages/rspack/node_modules/make-dir/readme.md b/webpack-test/packages/rspack/node_modules/make-dir/readme.md
new file mode 100644
index 00000000000..8c225c1f6a7
--- /dev/null
+++ b/webpack-test/packages/rspack/node_modules/make-dir/readme.md
@@ -0,0 +1,123 @@
+# make-dir [![Build Status](https://travis-ci.org/sindresorhus/make-dir.svg?branch=master)](https://travis-ci.org/sindresorhus/make-dir) [![codecov](https://codecov.io/gh/sindresorhus/make-dir/branch/master/graph/badge.svg)](https://codecov.io/gh/sindresorhus/make-dir)
+
+> Make a directory and its parents if needed - Think `mkdir -p`
+
+
+## Advantages over [`mkdirp`](https://github.com/substack/node-mkdirp)
+
+- Promise API *(Async/await ready!)*
+- Fixes many `mkdirp` issues: [#96](https://github.com/substack/node-mkdirp/pull/96) [#70](https://github.com/substack/node-mkdirp/issues/70) [#66](https://github.com/substack/node-mkdirp/issues/66)
+- 100% test coverage
+- CI-tested on macOS, Linux, and Windows
+- Actively maintained
+- Doesn't bundle a CLI
+- Uses native the `fs.mkdir/mkdirSync` [`recursive` option](https://nodejs.org/dist/latest/docs/api/fs.html#fs_fs_mkdir_path_options_callback) in Node.js >=10.12.0 unless [overridden](#fs)
+
+
+## Install
+
+```
+$ npm install make-dir
+```
+
+
+## Usage
+
+```
+$ pwd
+/Users/sindresorhus/fun
+$ tree
+.
+```
+
+```js
+const makeDir = require('make-dir');
+
+(async () => {
+ const path = await makeDir('unicorn/rainbow/cake');
+
+ console.log(path);
+ //=> '/Users/sindresorhus/fun/unicorn/rainbow/cake'
+})();
+```
+
+```
+$ tree
+.
+└── unicorn
+ └── rainbow
+ └── cake
+```
+
+Multiple directories:
+
+```js
+const makeDir = require('make-dir');
+
+(async () => {
+ const paths = await Promise.all([
+ makeDir('unicorn/rainbow'),
+ makeDir('foo/bar')
+ ]);
+
+ console.log(paths);
+ /*
+ [
+ '/Users/sindresorhus/fun/unicorn/rainbow',
+ '/Users/sindresorhus/fun/foo/bar'
+ ]
+ */
+})();
+```
+
+
+## API
+
+### makeDir(path, [options])
+
+Returns a `Promise` for the path to the created directory.
+
+### makeDir.sync(path, [options])
+
+Returns the path to the created directory.
+
+#### path
+
+Type: `string`
+
+Directory to create.
+
+#### options
+
+Type: `Object`
+
+##### mode
+
+Type: `integer`
+Default: `0o777 & (~process.umask())`
+
+Directory [permissions](https://x-team.com/blog/file-system-permissions-umask-node-js/).
+
+##### fs
+
+Type: `Object`
+Default: `require('fs')`
+
+Use a custom `fs` implementation. For example [`graceful-fs`](https://github.com/isaacs/node-graceful-fs).
+
+Using a custom `fs` implementation will block the use of the native `recursive` option if `fs.mkdir` or `fs.mkdirSync` is not the native function.
+
+
+## Related
+
+- [make-dir-cli](https://github.com/sindresorhus/make-dir-cli) - CLI for this module
+- [del](https://github.com/sindresorhus/del) - Delete files and directories
+- [globby](https://github.com/sindresorhus/globby) - User-friendly glob matching
+- [cpy](https://github.com/sindresorhus/cpy) - Copy files
+- [cpy-cli](https://github.com/sindresorhus/cpy-cli) - Copy files on the command-line
+- [move-file](https://github.com/sindresorhus/move-file) - Move a file
+
+
+## License
+
+MIT © [Sindre Sorhus](https://sindresorhus.com)
diff --git a/webpack-test/scripts/test-metric-util.js b/webpack-test/scripts/test-metric-util.js
index d161657ab91..e5755801e84 100644
--- a/webpack-test/scripts/test-metric-util.js
+++ b/webpack-test/scripts/test-metric-util.js
@@ -60,8 +60,8 @@ function renderAllTestsToMarkdown(jsonObj) {
const testResults = jsonObj["testResults"];
return testResults
.flatMap(testSuite => testSuite.assertionResults)
- // use 1\. to break GitHub markdown list auto ordering
- .map((test, index) => `${index + 1}\. ${renderTestToMarkdown(test.fullName)}`)
+ // use `1 ` to break GitHub markdown list auto ordering
+ .map((test, index) => `${index + 1} ${renderTestToMarkdown(test.fullName)}`)
.join('\n')
}