davidmyersdev/vite-plugin-node-polyfills

When vite define contains process.env: xx, process polyfill will fail

winixt opened this issue · 2 comments

import { defineConfig } from 'vite'
import { nodePolyfills } from 'vite-plugin-node-polyfills'

// https://vitejs.dev/config/
export default defineConfig({
  define: {
    "process.env.A": 1,
  },
  plugins: [
     nodePolyfills({
       globals: {
          process: true,
       },
    }),
  ],
})

image

Hey @winixt. Would you mind adding a reproducible example via Stackblitz or similar?