https://github.com/twhy/vite-joyid
https://github.com/twhy/vite-joyid
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/twhy/vite-joyid
- Owner: twhy
- Created: 2024-06-05T08:09:16.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-05T08:13:45.000Z (about 2 years ago)
- Last Synced: 2024-12-27T21:42:35.145Z (over 1 year ago)
- Language: TypeScript
- Size: 40 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Vite + JoyID
## Trouble Shooting
`Buffer is not defined`
1. Install `@esbuild-plugins/node-globals-polyfill`
2. In `vite.config.js`
```ts
import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill'
export default defineConfig({
// ...other config settings
optimizeDeps: {
esbuildOptions: {
// Node.js global to browser globalThis
define: {
global: 'globalThis'
},
// Enable esbuild polyfill plugins
plugins: [
NodeGlobalsPolyfillPlugin({
buffer: true
})
]
}
}
})
```