Skip to content
This repository was archived by the owner on Aug 30, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/sdk",
"version": "2.3.5",
"version": "2.3.6-0",
"description": "The main thirdweb SDK.",
"repository": {
"type": "git",
Expand Down Expand Up @@ -72,6 +72,7 @@
"hardhat": "2.9.3",
"merkletreejs": "^0.2.24",
"mocha": "^10.0.0",
"node-stdlib-browser": "^1.2.0",
"prettier": "^2.4.1",
"ts-mocha": "^10.0.0",
"ts-node": "^10.7.0",
Expand Down
14 changes: 12 additions & 2 deletions tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { defineConfig } from "tsup";

import { NodeModulesPolyfillPlugin } from "@esbuild-plugins/node-modules-polyfill";
import plugin from "node-stdlib-browser/helpers/esbuild/plugin";
import stdLibBrowser from "node-stdlib-browser";

export default defineConfig([
// build for node
Expand Down Expand Up @@ -42,7 +44,11 @@ export default defineConfig([
format: ["cjs", "esm"],
// contains node-only functions, aka has to be bundled in for browser
noExternal: ["cbor"],
esbuildPlugins: [NodeModulesPolyfillPlugin()],
inject: [`node_modules/node-stdlib-browser/helpers/esbuild/shim.js`],
define: {
Buffer: "Buffer",
},
esbuildPlugins: [NodeModulesPolyfillPlugin(), plugin(stdLibBrowser)],
outDir: "dist/browser",
},
// build for script-tag usage <script src="..."></script>
Expand All @@ -64,7 +70,11 @@ export default defineConfig([
},
// inject ThirdwebSDK into window
footer: { js: "window.ThirdwebSDK = window._thirdweb.ThirdwebSDK;" },
esbuildPlugins: [NodeModulesPolyfillPlugin()],
inject: [`node_modules/node-stdlib-browser/helpers/esbuild/shim.js`],
define: {
Buffer: "Buffer",
},
esbuildPlugins: [NodeModulesPolyfillPlugin(), plugin(stdLibBrowser)],
outDir: "dist/browser",
},
]);
Loading