Skip to content

Commit b112e6c

Browse files
build: Bundle polyfills for Node.js in version-specific packages
`dist/esm/browser.js` in `@ruby/wasm-wasi` no longer contains polyfills for Node.js, so we need to bundle them in the version-specific packages.
1 parent 26e3d7f commit b112e6c

File tree

2 files changed

+8
-20
lines changed

2 files changed

+8
-20
lines changed

packages/npm-packages/ruby-3.2-wasm-wasi/rollup.config.mjs

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../ruby-head-wasm-wasi/rollup.config.mjs

packages/npm-packages/ruby-head-wasm-wasi/rollup.config.mjs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import json from "@rollup/plugin-json";
2+
import inject from "@rollup/plugin-inject";
23
import { nodeResolve } from "@rollup/plugin-node-resolve";
4+
import nodePolyfills from "rollup-plugin-polyfill-node";
35
import fs from "fs";
46
import path from "path";
57

@@ -14,6 +16,10 @@ export default [
1416
banner: "/* " + fs.readFileSync(path.resolve("../../../NOTICE"), "utf8") + "*/",
1517
}
1618
],
17-
plugins: [json(), nodeResolve()],
19+
plugins: [
20+
nodePolyfills(),
21+
inject({ Buffer: ["buffer", "Buffer"] }),
22+
json(), nodeResolve()
23+
],
1824
},
1925
];

0 commit comments

Comments
 (0)