As a curious developer,
In order to try out esbuild on an existing project,
I'd like to be able to run esbuild without first renaming a lot of files.
Given that the React projects I've seen so far used .js everywhere (because for .jsx other tools just didn't work), would a command line option be very bad? It could be named --accept-slowdown-treat-all-js-as-jsx :) or maybe just --jsx or something?
Yes, this is a good idea. I'm actually already planning on doing this. I'm planning to have a hard-coded set of loaders built into the executable, which can then be overridden per file extension. This is a more general-purpose mechanism that will also be helpful for other loaders. For example, you may want to have each .png
file loaded as a base64 string. I'm not sure what the exact syntax will be yet.
So, for the parameter format, what are some options? Does any tool do this already? Is this something akin to a babel-ish preset? One cool approach could be ~--go,go,FILENAME-gadget~ ehm... --use=jsx and that goes and fetches from the git repo and caches jsx.esbuild.yml from then on. And the yml can contain various things. Too much too soon? :)
Most helpful comment
Yes, this is a good idea. I'm actually already planning on doing this. I'm planning to have a hard-coded set of loaders built into the executable, which can then be overridden per file extension. This is a more general-purpose mechanism that will also be helpful for other loaders. For example, you may want to have each
.png
file loaded as a base64 string. I'm not sure what the exact syntax will be yet.