vite-plugin-node-polyfills
vite-plugin-node-polyfills copied to clipboard
A Vite plugin to polyfill Node's Core Modules for browser environments.
Globals are always defined in the global scope regardless of configuration. Here is my config: ```javascript import { defineConfig } from 'vite' import { nodePolyfills } from 'vite-plugin-node-polyfills' export default...
Currently, it seems vite or astro has a bug that breaks all `vite-plugin-node-polyfills`, but not the global variables. So I’m trying to keep: ``` globals: { Buffer: true, global: false,...
**Problem** - I'm using Sanity Studio V3 and they define a `process.env.MODE` variable using Vite's define config. - This causes the `process` polyfill module to not be applied, and instead...
- fixes #48 ## Overview TBD ```ts import { defineConfig } from 'vite' import { nodePolyfills } from 'vite-plugin-node-polyfills' // https://vitejs.dev/config/ export default defineConfig({ plugins: [ nodePolyfills({ overrides: { 'fs':...
Reproduction: https://github.com/Jinjiang/reproductions/tree/vite-node-polyfill-20240214 ```bash pnpm install pnpm build ``` error log: ``` error during build: RollupError: "existsSync" is not exported by "node_modules/.pnpm/[email protected]/node_modules/node-stdlib-browser/esm/mock/empty.js", imported by "src/index.ts". ... ``` if works if you...
This issue is a placeholder to track work related to the `v1` release. - https://github.com/davidmyersdev/vite-plugin-node-polyfills/issues/72 - https://github.com/davidmyersdev/vite-plugin-node-polyfills/issues/48
Migrate to [`unenv`](https://github.com/unjs/unenv). See https://github.com/davidmyersdev/vite-plugin-node-polyfills/issues/67 and https://github.com/nuxt/nuxt/issues/25016.
```js 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,...
### Summary Hi There, The polyfill doesn't seem to be working for the above mentioned package. Also attaching the screenshot of the error from console for more info. 
### Summary I am getting the following error when I added the plugin sanitize-html.js?v=a55f9d5f:6974 Uncaught TypeError: Cannot destructure property 'existsSync' of 'require_empty(...)' as it is null. It's coming from the...