Skip to content

Commit

Permalink
test pr
Browse files Browse the repository at this point in the history
  • Loading branch information
SyMind committed Nov 19, 2024
1 parent d6ac6bc commit 8f73b50
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
- uses: ./.github/actions/prepare-rspack-binding
with:
path: ${{ env.RSPACK_DIR }}
ref: pull/8470/head

bench:
needs: prepare-binding
Expand All @@ -45,6 +46,7 @@ jobs:
- uses: ./.github/actions/build-rspack
with:
path: ${{ env.RSPACK_DIR }}
ref: pull/8470/head
- name: Run benchmark
run: node bin/cli.js bench --shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
- id: print-compare-results
Expand Down
5 changes: 4 additions & 1 deletion lib/addons/traverse-module-graph/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import path from "path";
import url from "url";
import { Addon } from "../common.js";

const __dirname = path.dirname(url.fileURLToPath(import.meta.url));

export default class extends Addon {
options = {
times: 10
Expand All @@ -10,7 +13,7 @@ export default class extends Addon {
ctx.config +
`
module.exports.plugins = module.exports.plugins || [];
const TraverseModuleGraphPlugin = require("${path.join(__dirname, 'plugin.js')}");
const TraverseModuleGraphPlugin = require("${path.join(__dirname, 'plugin.cjs')}");
module.exports.plugins.push(new TraverseModuleGraphPlugin());
`;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ class TraverseModuleGraphPlugin {
function traverse(dependency) {
const module = compilation.moduleGraph.getModule(dependency);
if (module) {
if (visitedModules.has(module)) {
return;
}
visitedModules.add(module);
for (const dep of module.dependencies) {
traverse(dep)
Expand Down

0 comments on commit 8f73b50

Please sign in to comment.