mirror of
https://github.com/maceip/zknft.git
synced 2026-01-09 12:27:54 -05:00
Update vite.config.ts
This commit is contained in:
@@ -1,8 +1,17 @@
|
||||
import { defineConfig } from "vite";
|
||||
import react from "@vitejs/plugin-react";
|
||||
import { nodePolyfills } from 'vite-plugin-node-polyfills';
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
plugins: [react(),
|
||||
nodePolyfills({
|
||||
include: ["buffer"],
|
||||
globals: {
|
||||
Buffer: true,
|
||||
},
|
||||
}),
|
||||
|
||||
],
|
||||
server: {
|
||||
port: 3000,
|
||||
fs: {
|
||||
@@ -13,5 +22,15 @@ export default defineConfig({
|
||||
target: "es2022",
|
||||
minify: true,
|
||||
sourcemap: true,
|
||||
rollupOptions: {
|
||||
plugins: [
|
||||
inject({
|
||||
// cbor-x checks for Buffer on the global object, and the polyfills plugin doesn't cover this case for the
|
||||
// production build (but works in development because Buffer gets injected as a banner, so it's "naturally"
|
||||
// available on the global object)
|
||||
"globalThis.Buffer": ["buffer", "Buffer"],
|
||||
}),
|
||||
],
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user