-
-
Notifications
You must be signed in to change notification settings - Fork 600
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support chunkGroup.getModulePreOrderIndex
- Loading branch information
Showing
7 changed files
with
93 additions
and
27 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
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
3 changes: 3 additions & 0 deletions
3
packages/rspack-test-tools/tests/configCases/chunks/module-order-index/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,3 @@ | ||
it("should compile", function (done) { | ||
done() | ||
}); |
24 changes: 24 additions & 0 deletions
24
packages/rspack-test-tools/tests/configCases/chunks/module-order-index/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,24 @@ | ||
/** @type {import("@rspack/core").Configuration} */ | ||
module.exports = { | ||
target: "node", | ||
entry: { | ||
'main': './index.js' | ||
}, | ||
plugins: [ | ||
{ | ||
/**@param {import("@rspack/core").Compiler} compiler */ | ||
apply(compiler) { | ||
compiler.hooks.thisCompilation.tap('test', (compilation) => { | ||
compilation.hooks.afterSeal.tap('test', () => { | ||
let entrypoint = compilation.entrypoints.get('main') | ||
|
||
compilation.chunkGraph.getChunkModules(entrypoint).forEach((m) => { | ||
expect(entrypoint.getModulePreOrderIndex(m)).toBeDefined(); | ||
expect(entrypoint.getModulePostOrderIndex(m)).toBeDefined(); | ||
}) | ||
}) | ||
}) | ||
} | ||
} | ||
] | ||
}; |
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