remorses/esbuild-plugins

vite build: "ReferenceError: process is not defined"

Closed this issue · 2 comments

I have a simple app which builds and works fine in dev environment. For some dependencies I had to add NodeGlobalsPolyfillPlugin({ process: true })

I found that when I build and deploy the app, I'm getting process is not defined from the bundle...

that's because vite uses rollup for prod builds, you need to add a process polyfill for rollup too, in the top level plugins option

Gotcha, thanks for a lightning fast reply