@orxataguy/tyr 1.0.11-beta.1 → 1.0.11-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/loader.mjs +9 -2
- package/package.json +1 -1
package/bin/loader.mjs
CHANGED
|
@@ -20,10 +20,17 @@ const TS_RE = /\.m?[ct]?ts$/;
|
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* load() — intercept every ESM import whose URL ends in a TypeScript extension.
|
|
23
|
-
*
|
|
23
|
+
*
|
|
24
|
+
* We do NOT exclude node_modules: the tyr package itself ships as .ts source
|
|
25
|
+
* (bin/tyr.ts, src/core/Kernel.ts, etc.) and those files ARE under node_modules
|
|
26
|
+
* when installed globally. Node.js 24's built-in strip-types refuses to handle
|
|
27
|
+
* .ts files under node_modules, so our loader must cover them.
|
|
28
|
+
*
|
|
29
|
+
* The TS_RE regex already limits interception to .ts/.mts/.cts files — the
|
|
30
|
+
* compiled .js files that third-party packages ship will never match it.
|
|
24
31
|
*/
|
|
25
32
|
export function load(url, context, next) {
|
|
26
|
-
const isTs = TS_RE.test(url)
|
|
33
|
+
const isTs = TS_RE.test(url);
|
|
27
34
|
if (!isTs) return next(url, context);
|
|
28
35
|
|
|
29
36
|
const filePath = fileURLToPath(url);
|