My project using vite for bundle and when I run tsc -b && vite build
it return this error
error during build:
[vite]: Rollup failed to resolve import "vite-plugin-node-polyfills/shims/global" from "<project path>/node_modules/@dfinity/agent/lib/esm/agent/index.js".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
My vite.config.ts file
import path from "path"
import react from "@vitejs/plugin-react"
import { defineConfig } from "vite"
import { nodePolyfills } from 'vite-plugin-node-polyfills'
export default defineConfig({
plugins: [react(), nodePolyfills({
globals: {
},
}),],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
})
My project using vite for bundle and when I run
tsc -b && vite build
it return this error
My
vite.config.ts
file