There was an error while loading. Please reload this page.
1 parent 95e042b commit b2a8de0Copy full SHA for b2a8de0
1 file changed
nuxt-config/hooks/index.ts
@@ -38,6 +38,21 @@ const HELIX_OPTIMIZE_DEPS = [
38
'@shared/transformer/oracle'
39
]
40
41
+function aliasBufferEntrypoint(config: any) {
42
+ config.resolve = config.resolve || {}
43
+
44
+ if (Array.isArray(config.resolve.alias)) {
45
+ config.resolve.alias.push({ find: /^buffer$/, replacement: 'buffer/' })
46
47
+ return
48
+ }
49
50
+ config.resolve.alias = {
51
+ ...(config.resolve.alias || {}),
52
+ buffer: 'buffer/'
53
54
+}
55
56
export default {
57
'pages:extend'(pages) {
58
const spotPage = pages.find((page) => page.name === TradePage.Spot)
@@ -81,6 +96,8 @@ export default {
81
96
82
97
},
83
98
'vite:extendConfig'(config: any) {
99
+ aliasBufferEntrypoint(config)
100
84
101
if (isProduction) {
85
102
return
86
103
}
0 commit comments