v0.9.0
Allow globals (Buffer
, global
, and process
) to be disabled for build
, dev
, or both.
import { defineConfig } from 'vite'
import { nodePolyfills } from 'vite-plugin-node-polyfills'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
nodePolyfills({
// Whether to polyfill specific globals.
globals: {
Buffer: 'dev', // defaults to true
global: false, // defaults to true
process: 'build', // defaults to true
},
}),
],
})