electron / website

:electron: The Electron website
https://electronjs.org
Apache License 2.0
111 stars 127 forks source link

fix(build): use `tsx` for build scripts #569

Closed erickzhao closed 3 months ago

erickzhao commented 3 months ago

I removed the ts-node dependency in #563, but forgot that we have a bunch of scripts that rely on being run with that package. 🤦

Unfortunately, the move to ES Modules for various packages we rely on made it impossible to just revert the config.

I ran into some issues despite running with the --esm flag, and there seem to be some upstream issues with ts-node and Node 20: https://github.com/TypeStrong/ts-node/issues/1997

I tried tsx as a drop-in replacement and it seems to work like a charm.

Note that this PR seems to have updated a bunch of docs via the pre-build script. I don't know why changes didn't pick this up before, but it seems like all these formatting changes the double whitespaces are present upstream. Might be related to the Remark-related package upgrades from the Docusaurus 3 upgrade.