egoist / rollup-plugin-esbuild

Use ESBuild with Rollup to transform ESNext and TypeScript code.
MIT License
627 stars 40 forks source link

browser: true ignored when used with @rollup/plugin-node-resolve #369

Open BryceMehring opened 1 year ago

BryceMehring commented 1 year ago

Same issue as https://github.com/rollup/plugins/issues/1267.

I'm getting

(!) Unresolved dependencies
https://rollupjs.org/troubleshooting/#warning-treating-module-as-external-dependency
zlib (imported by "zlib?commonjs-external")
http (imported by "http?commonjs-external")
https (imported by "https?commonjs-external")
assert (imported by "assert?commonjs-external")
stream (imported by "stream?commonjs-external")

What fixes this problem is running this plugin as:

{
  ...esbuild(),
  resolveId: undefined,
}
tbrannam commented 5 months ago

In my environment I needed to replace resolveId a little differently.

{
  ...esbuild(),
  resolveId: () => null,
}