Commit f9ab45e
committed
fix(common): update TS module resolution flow
This commit updates the implementation for resolving `.ts` files.
Instead of registering the `ts-node` project only once, we now refrain from
doing so since there might be multiple projects with different configurations.
The current approach involves dynamically switching the implementation for
registering and unregistering the project after the `.ts` file has been transpiled
and resolved. This change addresses an issue where warnings were encountered when
`ts-node` attempted to register with different configurations. The number of configurations
is no longer a concern, as each time we need to read a `.ts` file, a new TS project is
registered. This adjustment does not impact performance or other attributes because `ts-node`
allows native project disabling. Part of the implementation has been adapted from what Nrwl Nx
already has; we can find their implementation here:
https://github.com/nrwl/nx/blob/master/packages/nx/src/plugins/js/utils/register.ts
It's worth noting that their implementation is somewhat versatile, as it also supports SWC.
Closes: #1197
Closes: #1213
Closes: #17301 parent a35e967 commit f9ab45e
File tree
21 files changed
+2018
-1151
lines changed- examples
- bazel
- custom-webpack/sanity-app-esm
- webpack-esm-plugin
- packages
- common
- src
- custom-esbuild/src
- application
- dev-server
- custom-webpack/src
- jest/src
21 files changed
+2018
-1151
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
0 commit comments