Skip to content

Commit

Permalink
fix: add missing affectedHooks parameter to ProvidePlugin (#8570)
Browse files Browse the repository at this point in the history
  • Loading branch information
inottn authored Nov 29, 2024
1 parent 245e85e commit 3a9ee55
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import fs from "fs";
import Worker from "worker-rspack-loader!./worker.js";

it("should work", () => {
Worker;
let file = fs.readFileSync(__dirname + "/bundle0.worker.js", "utf-8");
expect(file).toContain('module.exports = "str"');
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const { rspack } = require("@rspack/core");

/** @type {import("@rspack/core").Configuration} */
module.exports = {
entry: {
main: ["./index.js"]
},
plugins: [
new rspack.ProvidePlugin({
str: "./str.js"
})
]
};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = "str";
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
str;
3 changes: 2 additions & 1 deletion packages/rspack/src/builtin-plugin/ProvidePlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ export const ProvidePlugin = create(
return [key, value];
});
return Object.fromEntries(entries);
}
},
"compilation"
);

2 comments on commit 3a9ee55

@rspack-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Benchmark detail: Open

Name Base (2024-11-29 d249e62) Current Change
10000_big_production-mode_disable-minimize + exec 42.6 s ± 1.08 s 42.2 s ± 379 ms -0.99 %
10000_development-mode + exec 1.8 s ± 43 ms 1.79 s ± 30 ms -0.81 %
10000_development-mode_hmr + exec 645 ms ± 6.9 ms 644 ms ± 4.1 ms -0.14 %
10000_production-mode + exec 2.38 s ± 27 ms 2.4 s ± 33 ms +0.81 %
arco-pro_development-mode + exec 1.75 s ± 65 ms 1.76 s ± 71 ms +0.73 %
arco-pro_development-mode_hmr + exec 426 ms ± 1.1 ms 426 ms ± 1.3 ms +0.03 %
arco-pro_production-mode + exec 3.07 s ± 46 ms 3.12 s ± 89 ms +1.72 %
arco-pro_production-mode_generate-package-json-webpack-plugin + exec 3.12 s ± 55 ms 3.16 s ± 85 ms +1.17 %
threejs_development-mode_10x + exec 1.62 s ± 20 ms 1.61 s ± 14 ms -0.21 %
threejs_development-mode_10x_hmr + exec 809 ms ± 17 ms 805 ms ± 11 ms -0.48 %
threejs_production-mode_10x + exec 4.92 s ± 16 ms 4.92 s ± 51 ms +0.05 %
10000_big_production-mode_disable-minimize + rss memory 13340 MiB ± 244 MiB 13417 MiB ± 178 MiB +0.57 %
10000_development-mode + rss memory 797 MiB ± 76.8 MiB 777 MiB ± 21 MiB -2.48 %
10000_development-mode_hmr + rss memory 2088 MiB ± 191 MiB 2085 MiB ± 181 MiB -0.15 %
10000_production-mode + rss memory 684 MiB ± 31.4 MiB 666 MiB ± 38.9 MiB -2.67 %
arco-pro_development-mode + rss memory 731 MiB ± 51.8 MiB 736 MiB ± 31.6 MiB +0.68 %
arco-pro_development-mode_hmr + rss memory 964 MiB ± 132 MiB 906 MiB ± 91 MiB -6.05 %
arco-pro_production-mode + rss memory 880 MiB ± 50 MiB 865 MiB ± 53 MiB -1.64 %
arco-pro_production-mode_generate-package-json-webpack-plugin + rss memory 892 MiB ± 72.2 MiB 898 MiB ± 46.9 MiB +0.69 %
threejs_development-mode_10x + rss memory 823 MiB ± 48.6 MiB 809 MiB ± 27.8 MiB -1.65 %
threejs_development-mode_10x_hmr + rss memory 1950 MiB ± 458 MiB 1985 MiB ± 503 MiB +1.79 %
threejs_production-mode_10x + rss memory 1067 MiB ± 69.2 MiB 1039 MiB ± 65.8 MiB -2.57 %

@rspack-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Ran ecosystem CI: Open

suite result
modernjs ❌ failure
_selftest ✅ success
rsdoctor ✅ success
rspress ✅ success
rslib ❌ failure
rsbuild ✅ success
examples ✅ success
devserver ❌ failure
nuxt ✅ success

Please sign in to comment.