rollup-plugin-esbuild icon indicating copy to clipboard operation
rollup-plugin-esbuild copied to clipboard

Add bundle option

Open shiftgeist opened this issue 5 years ago • 3 comments

eslint has a bundle: true|false (default: false) option. it would be useful to have this option in this rollup plugin as well. the option also replaces @rollup/plugin-node-resolve if i'm not mistaken.

shiftgeist avatar Oct 09 '20 08:10 shiftgeist

hmm then why not use esbuild directly?

egoist avatar Oct 09 '20 10:10 egoist

because sometimes you need more than just bundled js: css with postcss, json, images, copy, etc

shiftgeist avatar Oct 09 '20 11:10 shiftgeist

So I guess you mean using esbuild to bundle JS files and ignore static assets like .css, .jpg etc and let Rollup handle them instead, that seems like a legit use case 👌

With that approach we essentially need to tell esbuild to ignore all relative imports that are not JS files, but unfortunately there's no easy way to do this until esbuild's plugin API is available. However when esbuild plugin API is available you'll probably no longer need Rollup and this plugin since you can write plugins for esbuild directly to handle static assets instead.

egoist avatar Oct 10 '20 05:10 egoist