-
-
Notifications
You must be signed in to change notification settings - Fork 545
Closed
Milestone
Description
Capturing a few items from my personal to-do list that need to be double-checked:
-
when
swc: true
, make sure path is an absolute path to ts-node's own SWC transpiler- absolute path to the swc transpiler, which itself is responsible for finding and loading
@swc/core
or@swc/wasm
- absolute path to the swc transpiler, which itself is responsible for finding and loading
-
Within swc transpiler
- use tsconfig-relative require() to find swc first
- fallback to require() relative to ts-node, in case ts-node is a global installation
-
When
transpiler
is a string, do project-local require -
When transpiler is the
ts-node/transpilers/swc-experimental
, also fallback to absolute path to globally-installed-ts-node-transpiler for backwards compat- can we do this with
require.resolve(specifier, {paths})
?
- can we do this with
-
Consider genericizing this require() logic
- We have several use-cases for this: locate transpiler, locate compiler, locate @swc/core|wasm, locate
--require
- make a single require.resolve wrapper that understands the nuance of how we locate dependencies in all the above situations
- if specifier comes from a tsconfig, attempt to resolve relative to tsconfig
- if specifier comes from API or CLI, attempt to resolve relative to ...
- CWD?
- entrypoint? (for shebangs?) No, the shebang case is handled by having a tsconfig next to the entrypoint
- We have several use-cases for this: locate transpiler, locate compiler, locate @swc/core|wasm, locate
-
tweak
swc
jsdoc to link to ts-node website, since it requires installing additional deps
Metadata
Metadata
Assignees
Labels
No labels