Skip to content

Commit 48a4adb

Browse files
committed
Use inject plugin instead
1 parent 22335bb commit 48a4adb

File tree

4 files changed

+19
-31
lines changed

4 files changed

+19
-31
lines changed

packages/npm-packages/ruby-head-wasm-wasi/package-lock.json

Lines changed: 12 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/npm-packages/ruby-head-wasm-wasi/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,8 @@
3030
"@rollup/plugin-json": "^6.0.0",
3131
"rollup": "^3.2.2",
3232
"rollup-plugin-polyfill-node": "^0.12.0"
33+
},
34+
"dependencies": {
35+
"@rollup/plugin-inject": "^5.0.3"
3336
}
3437
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import inject from "@rollup/plugin-inject";
12
import json from "@rollup/plugin-json";
23
import fs from "fs";
34
import path from "path";
@@ -17,6 +18,9 @@ export default [
1718
plugins: [
1819
json(),
1920
nodePolyfills(),
21+
inject({
22+
Buffer: ["buffer", "Buffer"],
23+
}),
2024
],
2125
},
2226
];
Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11

2-
import { Buffer } from "buffer";
3-
42
import { main } from "../../ruby-wasm-wasi/dist/browser.script.esm"
53
import * as pkg from "../package.json"
64

7-
// Since `Buffer.from` is used by `@wasmer/wasi`,
8-
// we export `Buffer` class into the global.
9-
globalThis.Buffer = Buffer;
10-
115
main(pkg)

0 commit comments

Comments
 (0)