Skip to content

Commit

Permalink
js: resolve bundling issues
Browse files Browse the repository at this point in the history
  • Loading branch information
dr497 committed Sep 4, 2024
1 parent 10445f1 commit 89707ae
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 3 deletions.
34 changes: 34 additions & 0 deletions js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"@pythnetwork/client": "^2.19.0",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-inject": "^5.0.5",
"@rollup/plugin-json": "^6.0.1",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-replace": "^5.0.5",
Expand Down
19 changes: 17 additions & 2 deletions js/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import replace from "@rollup/plugin-replace";
import babel from "@rollup/plugin-babel";
import { visualizer } from "rollup-plugin-visualizer";
import multiInput from "rollup-plugin-multi-input";
import inject from "@rollup/plugin-inject";

/**
* @type {import('rollup').RollupOptions}
Expand Down Expand Up @@ -43,15 +44,29 @@ export default {
preserveModulesRoot: "src",
},
],
external: ["@solana/web3.js"],
external: [
"@solana/web3.js",
"@solana/buffer-layout-utils",
"@solana/buffer-layout",
],
plugins: [
multiInput.default(),
nodeResolve({
browser: true,
preferBuiltins: false,
dedupe: ["borsh", "@solana/spl-token", "bn.js", "buffer"],
dedupe: [
"borsh",
"@solana/spl-token",
"bn.js",
"buffer",
"@solana/buffer-layout-utils",
"@solana/buffer-layout",
],
}),
commonjs(),
inject({
Buffer: ["buffer", "Buffer"],
}),
typescript({
tsconfig: "./tsconfig.json",
declaration: false,
Expand Down
2 changes: 1 addition & 1 deletion js/src/record_v2/serializeRecordV2Content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
InvalidInjectiveAddressError,
InvalidRecordInputError,
} from "../error";

import { Buffer } from "buffer";
import { UTF8_ENCODED, EVM_RECORDS } from "./const";

/**
Expand Down

0 comments on commit 89707ae

Please sign in to comment.