Skip to content

Commit 30a9016

Browse files
committed
test pr
1 parent d6ac6bc commit 30a9016

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
- uses: ./.github/actions/prepare-rspack-binding
2828
with:
2929
path: ${{ env.RSPACK_DIR }}
30+
ref: pull/8470/head
3031

3132
bench:
3233
needs: prepare-binding
@@ -45,6 +46,7 @@ jobs:
4546
- uses: ./.github/actions/build-rspack
4647
with:
4748
path: ${{ env.RSPACK_DIR }}
49+
ref: pull/8470/head
4850
- name: Run benchmark
4951
run: node bin/cli.js bench --shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
5052
- id: print-compare-results

lib/addons/traverse-module-graph/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import path from "path";
2+
import url from "url";
23
import { Addon } from "../common.js";
34

5+
const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
6+
47
export default class extends Addon {
58
options = {
69
times: 10
@@ -10,7 +13,7 @@ export default class extends Addon {
1013
ctx.config +
1114
`
1215
module.exports.plugins = module.exports.plugins || [];
13-
const TraverseModuleGraphPlugin = require("${path.join(__dirname, 'plugin.js')}");
16+
const TraverseModuleGraphPlugin = require("${path.join(__dirname, 'plugin.cjs')}");
1417
module.exports.plugins.push(new TraverseModuleGraphPlugin());
1518
`;
1619
}

lib/addons/traverse-module-graph/plugin.js renamed to lib/addons/traverse-module-graph/plugin.cjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ class TraverseModuleGraphPlugin {
1111
function traverse(dependency) {
1212
const module = compilation.moduleGraph.getModule(dependency);
1313
if (module) {
14+
if (visitedModules.has(module)) {
15+
return;
16+
}
1417
visitedModules.add(module);
1518
for (const dep of module.dependencies) {
1619
traverse(dep)
@@ -23,8 +26,6 @@ class TraverseModuleGraphPlugin {
2326
traverse(dependency)
2427
}
2528
}
26-
27-
console.log("Visited module number: ", visitedModules.size);
2829
});
2930
});
3031
}

0 commit comments

Comments
 (0)