vite-plugin-node-polyfills icon indicating copy to clipboard operation
vite-plugin-node-polyfills copied to clipboard

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

Open winixt opened this issue 2 years ago • 1 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

winixt avatar Jan 11 '24 13:01 winixt

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

davidmyersdev avatar Jan 14 '24 18:01 davidmyersdev

I'm closing this for now. If a reproduction of the issue is provided, I'll reopen it.

davidmyersdev avatar Oct 17 '24 03:10 davidmyersdev