From 9adb45666b1dbcb1169c52cabde397ed37ae44ed Mon Sep 17 00:00:00 2001 From: Boshen Date: Fri, 20 Oct 2023 16:04:53 +0800 Subject: [PATCH 1/2] chore: enable oxc_resolver in webpack tests closes #4317 --- webpack-test/ConfigTestCases.template.js | 3 +++ webpack-test/cases/resolving/browser-field/test.filter.js | 3 --- .../cases/resolving/commomjs-local-module/test.filter.js | 3 --- webpack-test/cases/resolving/context/test.filter.js | 3 --- webpack-test/cases/resolving/data-uri/test.filter.js | 3 --- webpack-test/cases/resolving/issue-11555/test.filter.js | 3 --- webpack-test/cases/resolving/issue-2986/test.filter.js | 3 --- webpack-test/cases/resolving/query/test.filter.js | 5 +---- .../cases/resolving/single-file-module/test.filter.js | 3 --- .../configCases/resolve-merging/override/test.filter.js | 2 +- .../resolve/context-resolve-with-ignore/test.filter.js | 2 +- .../configCases/resolve/empty-context-module/test.filter.js | 2 +- webpack-test/configCases/resolve/fallback/test.filter.js | 2 +- .../resolve/issue-11335-context-module/test.filter.js | 2 +- webpack-test/configCases/resolve/issue-15580/test.filter.js | 2 +- webpack-test/configCases/resolve/multi-alias/test.filter.js | 2 +- webpack-test/configCases/resolve/only-module/test.filter.js | 2 +- .../configCases/resolving/extensions-order/test.filter.js | 2 +- .../configCases/resolving/prefer-absolute/test.filter.js | 2 +- .../configCases/resolving/prefer-root/test.filter.js | 2 +- 20 files changed, 15 insertions(+), 36 deletions(-) diff --git a/webpack-test/ConfigTestCases.template.js b/webpack-test/ConfigTestCases.template.js index efb9ff81776..a87829c65ef 100644 --- a/webpack-test/ConfigTestCases.template.js +++ b/webpack-test/ConfigTestCases.template.js @@ -137,6 +137,9 @@ const describeCases = config => { // path.resolve(__dirname, "../node_modules") // ]; // } + if (!options.experiments) options.experiments = {}; + if (!options.experiments.rspackFuture) options.experiments.rspackFuture = {}; + options.experiments.rspackFuture.newResolver = true; }); testConfig = { findBundle: function(i, options) { diff --git a/webpack-test/cases/resolving/browser-field/test.filter.js b/webpack-test/cases/resolving/browser-field/test.filter.js index 0557cb116c1..98e4afe7608 100644 --- a/webpack-test/cases/resolving/browser-field/test.filter.js +++ b/webpack-test/cases/resolving/browser-field/test.filter.js @@ -1,4 +1 @@ - module.exports = () => {return false} - - \ No newline at end of file diff --git a/webpack-test/cases/resolving/commomjs-local-module/test.filter.js b/webpack-test/cases/resolving/commomjs-local-module/test.filter.js index 0557cb116c1..98e4afe7608 100644 --- a/webpack-test/cases/resolving/commomjs-local-module/test.filter.js +++ b/webpack-test/cases/resolving/commomjs-local-module/test.filter.js @@ -1,4 +1 @@ - module.exports = () => {return false} - - \ No newline at end of file diff --git a/webpack-test/cases/resolving/context/test.filter.js b/webpack-test/cases/resolving/context/test.filter.js index 0557cb116c1..98e4afe7608 100644 --- a/webpack-test/cases/resolving/context/test.filter.js +++ b/webpack-test/cases/resolving/context/test.filter.js @@ -1,4 +1 @@ - module.exports = () => {return false} - - \ No newline at end of file diff --git a/webpack-test/cases/resolving/data-uri/test.filter.js b/webpack-test/cases/resolving/data-uri/test.filter.js index 0557cb116c1..98e4afe7608 100644 --- a/webpack-test/cases/resolving/data-uri/test.filter.js +++ b/webpack-test/cases/resolving/data-uri/test.filter.js @@ -1,4 +1 @@ - module.exports = () => {return false} - - \ No newline at end of file diff --git a/webpack-test/cases/resolving/issue-11555/test.filter.js b/webpack-test/cases/resolving/issue-11555/test.filter.js index 0557cb116c1..98e4afe7608 100644 --- a/webpack-test/cases/resolving/issue-11555/test.filter.js +++ b/webpack-test/cases/resolving/issue-11555/test.filter.js @@ -1,4 +1 @@ - module.exports = () => {return false} - - \ No newline at end of file diff --git a/webpack-test/cases/resolving/issue-2986/test.filter.js b/webpack-test/cases/resolving/issue-2986/test.filter.js index 0557cb116c1..98e4afe7608 100644 --- a/webpack-test/cases/resolving/issue-2986/test.filter.js +++ b/webpack-test/cases/resolving/issue-2986/test.filter.js @@ -1,4 +1 @@ - module.exports = () => {return false} - - \ No newline at end of file diff --git a/webpack-test/cases/resolving/query/test.filter.js b/webpack-test/cases/resolving/query/test.filter.js index 0557cb116c1..8e5c51af343 100644 --- a/webpack-test/cases/resolving/query/test.filter.js +++ b/webpack-test/cases/resolving/query/test.filter.js @@ -1,4 +1 @@ - -module.exports = () => {return false} - - \ No newline at end of file +module.exports = () => {return true} diff --git a/webpack-test/cases/resolving/single-file-module/test.filter.js b/webpack-test/cases/resolving/single-file-module/test.filter.js index 0557cb116c1..98e4afe7608 100644 --- a/webpack-test/cases/resolving/single-file-module/test.filter.js +++ b/webpack-test/cases/resolving/single-file-module/test.filter.js @@ -1,4 +1 @@ - module.exports = () => {return false} - - \ No newline at end of file diff --git a/webpack-test/configCases/resolve-merging/override/test.filter.js b/webpack-test/configCases/resolve-merging/override/test.filter.js index 3be456dcd23..98e4afe7608 100644 --- a/webpack-test/configCases/resolve-merging/override/test.filter.js +++ b/webpack-test/configCases/resolve-merging/override/test.filter.js @@ -1 +1 @@ -module.exports = () => {return false} \ No newline at end of file +module.exports = () => {return false} diff --git a/webpack-test/configCases/resolve/context-resolve-with-ignore/test.filter.js b/webpack-test/configCases/resolve/context-resolve-with-ignore/test.filter.js index 3be456dcd23..98e4afe7608 100644 --- a/webpack-test/configCases/resolve/context-resolve-with-ignore/test.filter.js +++ b/webpack-test/configCases/resolve/context-resolve-with-ignore/test.filter.js @@ -1 +1 @@ -module.exports = () => {return false} \ No newline at end of file +module.exports = () => {return false} diff --git a/webpack-test/configCases/resolve/empty-context-module/test.filter.js b/webpack-test/configCases/resolve/empty-context-module/test.filter.js index 3be456dcd23..98e4afe7608 100644 --- a/webpack-test/configCases/resolve/empty-context-module/test.filter.js +++ b/webpack-test/configCases/resolve/empty-context-module/test.filter.js @@ -1 +1 @@ -module.exports = () => {return false} \ No newline at end of file +module.exports = () => {return false} diff --git a/webpack-test/configCases/resolve/fallback/test.filter.js b/webpack-test/configCases/resolve/fallback/test.filter.js index 3be456dcd23..8e5c51af343 100644 --- a/webpack-test/configCases/resolve/fallback/test.filter.js +++ b/webpack-test/configCases/resolve/fallback/test.filter.js @@ -1 +1 @@ -module.exports = () => {return false} \ No newline at end of file +module.exports = () => {return true} diff --git a/webpack-test/configCases/resolve/issue-11335-context-module/test.filter.js b/webpack-test/configCases/resolve/issue-11335-context-module/test.filter.js index 3be456dcd23..98e4afe7608 100644 --- a/webpack-test/configCases/resolve/issue-11335-context-module/test.filter.js +++ b/webpack-test/configCases/resolve/issue-11335-context-module/test.filter.js @@ -1 +1 @@ -module.exports = () => {return false} \ No newline at end of file +module.exports = () => {return false} diff --git a/webpack-test/configCases/resolve/issue-15580/test.filter.js b/webpack-test/configCases/resolve/issue-15580/test.filter.js index 3be456dcd23..98e4afe7608 100644 --- a/webpack-test/configCases/resolve/issue-15580/test.filter.js +++ b/webpack-test/configCases/resolve/issue-15580/test.filter.js @@ -1 +1 @@ -module.exports = () => {return false} \ No newline at end of file +module.exports = () => {return false} diff --git a/webpack-test/configCases/resolve/multi-alias/test.filter.js b/webpack-test/configCases/resolve/multi-alias/test.filter.js index 3be456dcd23..8e5c51af343 100644 --- a/webpack-test/configCases/resolve/multi-alias/test.filter.js +++ b/webpack-test/configCases/resolve/multi-alias/test.filter.js @@ -1 +1 @@ -module.exports = () => {return false} \ No newline at end of file +module.exports = () => {return true} diff --git a/webpack-test/configCases/resolve/only-module/test.filter.js b/webpack-test/configCases/resolve/only-module/test.filter.js index 3be456dcd23..98e4afe7608 100644 --- a/webpack-test/configCases/resolve/only-module/test.filter.js +++ b/webpack-test/configCases/resolve/only-module/test.filter.js @@ -1 +1 @@ -module.exports = () => {return false} \ No newline at end of file +module.exports = () => {return false} diff --git a/webpack-test/configCases/resolving/extensions-order/test.filter.js b/webpack-test/configCases/resolving/extensions-order/test.filter.js index 3be456dcd23..8e5c51af343 100644 --- a/webpack-test/configCases/resolving/extensions-order/test.filter.js +++ b/webpack-test/configCases/resolving/extensions-order/test.filter.js @@ -1 +1 @@ -module.exports = () => {return false} \ No newline at end of file +module.exports = () => {return true} diff --git a/webpack-test/configCases/resolving/prefer-absolute/test.filter.js b/webpack-test/configCases/resolving/prefer-absolute/test.filter.js index 3be456dcd23..98e4afe7608 100644 --- a/webpack-test/configCases/resolving/prefer-absolute/test.filter.js +++ b/webpack-test/configCases/resolving/prefer-absolute/test.filter.js @@ -1 +1 @@ -module.exports = () => {return false} \ No newline at end of file +module.exports = () => {return false} diff --git a/webpack-test/configCases/resolving/prefer-root/test.filter.js b/webpack-test/configCases/resolving/prefer-root/test.filter.js index 3be456dcd23..98e4afe7608 100644 --- a/webpack-test/configCases/resolving/prefer-root/test.filter.js +++ b/webpack-test/configCases/resolving/prefer-root/test.filter.js @@ -1 +1 @@ -module.exports = () => {return false} \ No newline at end of file +module.exports = () => {return false} From 10259a46c5457cebf4c779470e52ae46883a3266 Mon Sep 17 00:00:00 2001 From: Boshen Date: Mon, 23 Oct 2023 16:42:42 +0800 Subject: [PATCH 2/2] add newResolver to webpack-test/TestCases.template.js --- webpack-test/TestCases.template.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/webpack-test/TestCases.template.js b/webpack-test/TestCases.template.js index c9f71b0479e..615356a049a 100644 --- a/webpack-test/TestCases.template.js +++ b/webpack-test/TestCases.template.js @@ -220,7 +220,10 @@ const describeCases = config => { // RSPACK exclusive: Rspack enables `css` by default. // Turning off here to fallback to webpack's default css processing logic. css: false, - ...(config.module ? { outputModule: true } : {}) + ...(config.module ? { outputModule: true } : {}), + rspackFuture: { + newResolver: true + } }, infrastructureLogging: config.cache && { debug: true,