mirror of
https://github.com/kccleoc/seedpgp-web.git
synced 2026-03-07 01:47:52 +08:00
fix: Add global Buffer polyfill to vite.config.ts
This commit is contained in:
@@ -24,6 +24,18 @@ export default defineConfig({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
buffer: 'buffer',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
optimizeDeps: {
|
||||||
|
esbuildOptions: {
|
||||||
|
define: {
|
||||||
|
global: 'globalThis'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
base: '/', // Always use root, since we're Cloudflare Pages only
|
base: '/', // Always use root, since we're Cloudflare Pages only
|
||||||
publicDir: 'public', // ← Explicitly set (should be default)
|
publicDir: 'public', // ← Explicitly set (should be default)
|
||||||
build: {
|
build: {
|
||||||
@@ -34,5 +46,6 @@ export default defineConfig({
|
|||||||
'__APP_VERSION__': JSON.stringify(appVersion),
|
'__APP_VERSION__': JSON.stringify(appVersion),
|
||||||
'__BUILD_HASH__': JSON.stringify(gitHash),
|
'__BUILD_HASH__': JSON.stringify(gitHash),
|
||||||
'__BUILD_TIMESTAMP__': JSON.stringify(new Date().toISOString()),
|
'__BUILD_TIMESTAMP__': JSON.stringify(new Date().toISOString()),
|
||||||
|
'global': 'globalThis',
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user