diff --git a/packages/rspack-test-tools/tests/configCases/plugins/compatibility-plugin/a.js b/packages/rspack-test-tools/tests/configCases/plugins/compatibility-plugin/a.js new file mode 100644 index 000000000000..0dceb3b1fdea --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/plugins/compatibility-plugin/a.js @@ -0,0 +1,6 @@ +function f(__webpack_require__) { + require('./b.js'); + return __webpack_require__ + 1 +} + +module.exports = f; \ No newline at end of file diff --git a/packages/rspack-test-tools/tests/configCases/plugins/compatibility-plugin/b.js b/packages/rspack-test-tools/tests/configCases/plugins/compatibility-plugin/b.js new file mode 100644 index 000000000000..111a1500cb2c --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/plugins/compatibility-plugin/b.js @@ -0,0 +1 @@ +module.exports = "b" \ No newline at end of file diff --git a/packages/rspack-test-tools/tests/configCases/plugins/compatibility-plugin/index.js b/packages/rspack-test-tools/tests/configCases/plugins/compatibility-plugin/index.js new file mode 100644 index 000000000000..161c8c6d5478 --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/plugins/compatibility-plugin/index.js @@ -0,0 +1,4 @@ +it("compatibility plugin", async () => { + const f = require("./a.js"); + expect(f(1)).toBe(2); +});