This repository was archived by the owner on Aug 30, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +360
-21
lines changed Expand file tree Collapse file tree 3 files changed +360
-21
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @thirdweb-dev/sdk" ,
3
- "version" : " 2.3.5 " ,
3
+ "version" : " 2.3.6-0 " ,
4
4
"description" : " The main thirdweb SDK." ,
5
5
"repository" : {
6
6
"type" : " git" ,
72
72
"hardhat" : " 2.9.3" ,
73
73
"merkletreejs" : " ^0.2.24" ,
74
74
"mocha" : " ^10.0.0" ,
75
+ "node-stdlib-browser" : " ^1.2.0" ,
75
76
"prettier" : " ^2.4.1" ,
76
77
"ts-mocha" : " ^10.0.0" ,
77
78
"ts-node" : " ^10.7.0" ,
Original file line number Diff line number Diff line change 1
1
import { defineConfig } from "tsup" ;
2
2
3
3
import { NodeModulesPolyfillPlugin } from "@esbuild-plugins/node-modules-polyfill" ;
4
+ import plugin from "node-stdlib-browser/helpers/esbuild/plugin" ;
5
+ import stdLibBrowser from "node-stdlib-browser" ;
4
6
5
7
export default defineConfig ( [
6
8
// build for node
@@ -42,7 +44,11 @@ export default defineConfig([
42
44
format : [ "cjs" , "esm" ] ,
43
45
// contains node-only functions, aka has to be bundled in for browser
44
46
noExternal : [ "cbor" ] ,
45
- esbuildPlugins : [ NodeModulesPolyfillPlugin ( ) ] ,
47
+ inject : [ `node_modules/node-stdlib-browser/helpers/esbuild/shim.js` ] ,
48
+ define : {
49
+ Buffer : "Buffer" ,
50
+ } ,
51
+ esbuildPlugins : [ NodeModulesPolyfillPlugin ( ) , plugin ( stdLibBrowser ) ] ,
46
52
outDir : "dist/browser" ,
47
53
} ,
48
54
// build for script-tag usage <script src="..."></script>
@@ -64,7 +70,11 @@ export default defineConfig([
64
70
} ,
65
71
// inject ThirdwebSDK into window
66
72
footer : { js : "window.ThirdwebSDK = window._thirdweb.ThirdwebSDK;" } ,
67
- esbuildPlugins : [ NodeModulesPolyfillPlugin ( ) ] ,
73
+ inject : [ `node_modules/node-stdlib-browser/helpers/esbuild/shim.js` ] ,
74
+ define : {
75
+ Buffer : "Buffer" ,
76
+ } ,
77
+ esbuildPlugins : [ NodeModulesPolyfillPlugin ( ) , plugin ( stdLibBrowser ) ] ,
68
78
outDir : "dist/browser" ,
69
79
} ,
70
80
] ) ;
You can’t perform that action at this time.
0 commit comments