Skip to content

Commit a4b4981

Browse files
Fix crypto.hash build error by adding Node.js polyfills
Added node-stdlib-browser to provide Node.js crypto compatibility for Vite Vue plugin. Resolves deployment failure caused by Bun's crypto implementation differences. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 3737710 commit a4b4981

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

bun.lockb

50.2 KB
Binary file not shown.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
},
2525
"devDependencies": {
2626
"@vitejs/plugin-vue": "6.0.1",
27+
"node-stdlib-browser": "^1.3.1",
2728
"typescript": "5.9.2",
2829
"vite": "7.1.1",
2930
"vue-tsc": "3.0.5"

vite.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { defineConfig } from 'vite'
22
import vue from '@vitejs/plugin-vue'
33
import path from 'path';
4+
import nodeStdlibBrowser from 'node-stdlib-browser';
45
// import { Plugin } from 'vite';
56

67
// function customIconPathPlugin(): Plugin {
@@ -32,7 +33,11 @@ export default defineConfig({
3233
plugins: [vue()],
3334
resolve: {
3435
alias: {
36+
...nodeStdlibBrowser,
3537
'@': path.resolve(__dirname, 'src')
3638
},
39+
},
40+
define: {
41+
global: 'globalThis',
3742
}
3843
})

0 commit comments

Comments
 (0)