Skip to content

Commit 140baa1

Browse files
committed
add include array to nodePolyfills
1 parent 63c9244 commit 140baa1

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

docs/svelte.config.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,13 @@ const config = {
4343
'@web3-react/url',
4444
'@web3-onboard/*'
4545
],
46-
plugins: [nodePolyfills({ crypto: true, http: true })]
46+
plugins: [
47+
nodePolyfills({
48+
include: ['node_modules/**/*.js', new RegExp('node_modules/.vite/.*js')],
49+
crypto: true,
50+
http: true
51+
})
52+
]
4753
},
4854
commonjsOptions: {
4955
transformMixedEsModules: true
@@ -64,11 +70,12 @@ const config = {
6470
theme: 'material-ocean'
6571
}
6672
}),
67-
nodePolyfills({
68-
include: ['node_modules/**/*.js', new RegExp('node_modules/.vite/.*js')],
69-
http: true,
70-
crypto: true
71-
})
73+
development &&
74+
nodePolyfills({
75+
include: ['node_modules/**/*.js', new RegExp('node_modules/.vite/.*js')],
76+
http: true,
77+
crypto: true
78+
})
7279
],
7380
define: {
7481
'import.meta.env.VERCEL': JSON.stringify(process.env.VERCEL)

0 commit comments

Comments
 (0)