davidmyersdev / vite-plugin-node-polyfills

A Vite plugin to polyfill Node's Core Modules for browser environments.
MIT License
263 stars 17 forks source link

bug: config `include: [],` treated as `no option is passed` #85

Open jlarmstrongiv opened 3 months ago

jlarmstrongiv commented 3 months ago

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,
          process: true,
        },

When disabling all polyfills by using include: [],, I would expect the result not to be the same as leaving include as undefined, which means including all polyfills.

I would expect vite-plugin-node-polyfills to include no modules in that case. Instead, I have to pass include: [""], to get the same effect.