-
-
Notifications
You must be signed in to change notification settings - Fork 602
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: chunkGraph.getModuleId binding API (#8680)
- Loading branch information
Showing
6 changed files
with
91 additions
and
46 deletions.
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
Empty file.
29 changes: 29 additions & 0 deletions
29
packages/rspack-test-tools/tests/configCases/chunk-graph/get-module-id/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,29 @@ | ||
class Plugin { | ||
apply(compiler) { | ||
compiler.hooks.compilation.tap("Test", compilation => { | ||
compilation.hooks.processAssets.tap("Test", () => { | ||
const module = Array.from(compilation.modules)[0]; | ||
const moduleId = compilation.chunkGraph.getModuleId(module); | ||
expect(moduleId).toBeTruthy(); | ||
}); | ||
}); | ||
} | ||
} | ||
|
||
/** @type {import("@rspack/core").Configuration} */ | ||
module.exports = { | ||
target: 'web', | ||
node: false, | ||
entry: { | ||
main: "./index.js" | ||
}, | ||
output: { | ||
filename: "[name].js" | ||
}, | ||
optimization: { | ||
sideEffects: false, | ||
}, | ||
plugins: [ | ||
new Plugin() | ||
] | ||
}; |
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
d1079dc
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
d1079dc
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