Releases: davidmyersdev/vite-plugin-node-polyfills
Releases · davidmyersdev/vite-plugin-node-polyfills
v0.15.0
- Ensure the predefined
onwarnhandler is invoked if it exists - Use
env.commandinstead ofenv.modeso that alternative modes work properly
v0.14.0
Add support for overriding default polyfills
v0.12.0
Add the include option to only polyfill the specified modules. Thanks @leticiavna for the PR!
v0.11.3
- Add a workaround for a Yarn v1 bug
v0.11.2
v0.11.2
- Make sure globals (
Buffer,global, andprocess) are properly shimmed in all environments. - Replace upstream global shims with newer dependencies
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
},
}),
],
})v0.8.2
Update usage examples
v0.8.1
Features
Specific modules can now be excluded via the new exclude configuration option.
nodePolyfills({
exclude: ['fs'],
})v0.7.0
Fix Vite optimization error on esbuild injected shims.
v0.6.0
Add support for Vite v4