-
-
Notifications
You must be signed in to change notification settings - Fork 595
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support
compilation.builtModules
(#7984)
* feat: support compilation.builtModules * feat: support compilation.builtModules
- Loading branch information
1 parent
cfd514a
commit 139fc1b
Showing
10 changed files
with
82 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/rspack-test-tools/tests/watchCases/compilation/built-modules/0/foo.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const v = 'foo' |
5 changes: 5 additions & 0 deletions
5
packages/rspack-test-tools/tests/watchCases/compilation/built-modules/0/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { v } from "./foo"; | ||
|
||
v; | ||
|
||
it("should run", function () { }); |
1 change: 1 addition & 0 deletions
1
packages/rspack-test-tools/tests/watchCases/compilation/built-modules/1/foo.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const v = 'fooo' |
21 changes: 21 additions & 0 deletions
21
packages/rspack-test-tools/tests/watchCases/compilation/built-modules/rspack.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
let firstRun = true; | ||
|
||
/** @type {import("@rspack/core").Configuration} */ | ||
module.exports = { | ||
plugins: [{ | ||
apply(compiler) { | ||
compiler.hooks.compilation.tap("test", (compilation) => { | ||
compilation.hooks.seal.tap("test", () => { | ||
const builtModules = Array.from(compilation.builtModules).map(m => m.rawRequest); | ||
builtModules.sort(); | ||
if (firstRun) { | ||
expect(builtModules).toEqual(["./foo", "./index.js"]); | ||
firstRun = false; | ||
} else { | ||
expect(builtModules).toEqual(["./foo"]); | ||
} | ||
}); | ||
}); | ||
} | ||
}] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
139fc1b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 Benchmark detail: Open
139fc1b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 Ran ecosystem CI: Open