-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compile to JavaScript and drop runtime dependency on tsx #850
Comments
This seems like it would help a lot of people. I've experimented a bit with esbuild:
(You can also add I had to specify, in tsconfig.json:
so that it would compile with top-level await. But then when I then run:
I get errors related to package.json [1]. If I force my way around this problem [2], it then fails on observablehq.config.ts (as it only accepts a js config file). If I rename the config file, I then get another error about package.json [3]. It doesn't seem complicated, it's just that I don't really know ho this is supposed to work. Maybe someone with a better knowledge of esbuild will come up with the best approach. [1] |
Some things I learned so far in #963:
In general it seems to work well, but the fact that the generated sources live in a different directory I think are going to cause problems for methods such as |
I love tsx during development, but I think we should compile to JavaScript on publish and drop the runtime dependency. This would allow us to support Node 18+ instead of requiring Node 20.6+, and it would fix confusing errors such as #847. It would just be “fewer moving parts” and more robust, and it shouldn’t be too technically challenging to run esbuild or tsc or whatever on publish.
The text was updated successfully, but these errors were encountered: