FredKSchott / rollup-plugin-polyfill-node

A modern Node.js polyfill for your Rollup bundle.
Other
175 stars 55 forks source link

stream export `Transform` is undefined #27

Open taylorjdawson opened 3 years ago

taylorjdawson commented 3 years ago

Even with this polly fill Transform is still undefined:

const { Transform } = require('stream')

Rollup config

{
...
plugins: [
        json(),
        builtinsPlugin,
        globalsPlugin,
        nodePolyfills({include: ['stream']}),
        resolve({
          browser: true,
          preferBuiltins: true
        })
      ],
 ...
}
souljorje commented 3 years ago

@taylorjdawson, 👋, could you fix this somehow?

kmdinake commented 2 years ago

@taylorjdawson and @souljorje did either of you manage to fix this?

souljorje commented 2 years ago

@kmdinake yep, I'm using Vite which uses Rollup under the hood, you need to polyfill stream in browser, here's what helped me: https://github.com/vitejs/vite/issues/3817#issuecomment-864450199