mkdist icon indicating copy to clipboard operation
mkdist copied to clipboard

Maybe provide options to define custom esbuild options?

Open uuau99999 opened this issue 2 years ago • 1 comments

Hello, I want to use unbuild with mkdist builder to bundle my vue component library and publish them to npm. When using it in my vite project, it seems like vite will not do transform code inside node_modules and, however, my code are required to run in a web browser with chormium 70 and some syntaxs like optional chain may not be supported. I found that using unbuild with rollup builder supports custom rollupOptions and thus can specify custom esbuild options while mkdist does not support custom esbuild options. Maybe mkdist can provide options to define custom esbuild options? Thanks a lot!

Inside: https://github.com/unjs/mkdist/blob/main/src/loaders/js.ts#L33 image

uuau99999 avatar Apr 15 '22 11:04 uuau99999

same issue +1

ssuupprr avatar Apr 26 '22 10:04 ssuupprr

Yes, I need pass the keep-names option to esbuild too.

snowyu avatar Mar 18 '23 09:03 snowyu

make a pr to support: #144

uuau99999 avatar Mar 30 '23 03:03 uuau99999

Hi. This will be possible in next release via esbuild option

pi0 avatar Jul 18 '23 15:07 pi0