mirror of
https://github.com/kccleoc/seedpgp-web.git
synced 2026-03-06 17:37:51 +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
|
||||
publicDir: 'public', // ← Explicitly set (should be default)
|
||||
build: {
|
||||
@@ -34,5 +46,6 @@ export default defineConfig({
|
||||
'__APP_VERSION__': JSON.stringify(appVersion),
|
||||
'__BUILD_HASH__': JSON.stringify(gitHash),
|
||||
'__BUILD_TIMESTAMP__': JSON.stringify(new Date().toISOString()),
|
||||
'global': 'globalThis',
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user