aspect-build / rules_esbuild

Bazel rules for https://esbuild.github.io/ JS bundler
https://docs.aspect.build/rules/aspect_rules_esbuild
Apache License 2.0
27 stars 27 forks source link

[FR]: Support entry_points with output_dir = False #155

Open josephglanville opened 1 year ago

josephglanville commented 1 year ago

What is the current behavior?

Currently when enabling either splitting or multiple entry-points then output_dir = True is enabled.

This is actually only necessary for the splitting case which will produce unpredictable output files, the multiple entry-point case will produce multiple files but those files will have predictable names based on the esbuild configuration.

Describe the feature

Setting entry_points will correctly declare outputs for each of the bundled outputs and source maps etc and only switch to output directory declaration if splitting is enabled.

Place1 commented 1 year ago

I think with support for this feature we might be able to use esbuild as a transpiler in rules_ts

josephglanville commented 1 year ago

Yeah it's essentially a requirement for use as a transpiler. I have this implemented on a branch. I will see if I can open a PR tomorrow or something after rebasing it.