davidmyersdev/vite-plugin-node-polyfills

If I define --mode on the cmdline I get 'ReferenceError: Buffer is not defined'

MikeMitterer opened this issue · 3 comments

Any ideas?
If I run vite without --mode it works. The thing is I have .env.live where I store "Live-spcific" vars...

[Update]
I think it's this line:
https://github.com/davidmyersdev/vite-plugin-node-polyfills/blob/main/src/index.ts#L183C45-L183C47

Other modes beside 'development' should not break your nice lib...
https://vitejs.dev/guide/env-and-mode.html

Hey there, @MikeMitterer. 👋 That absolutely makes sense, and it looks like I can rely on env.command to determine whether it's running in "dev" or "build" mode. Thanks for bringing this to my attention!

This has been released in v0.15.0.

@davidmyersdev Very cool + Thanks!