### Search Terms Slow import Long time import <!-- What search terms did you use when trying to find an existing bug report? List them here so people in the future can find this one more easily. Remember to include *closed* issues in your search. --> ### Expected Behavior Speed regardless of the indication of `allowJs` ### Actual Behavior Import without `allowJs` option takes about 0.5 ms Import with `allowJs` option is `true` takes about 43 ms ### Steps to reproduce the problem 1. Create commonJS file with other files imports 2. Compare speed with `allowJs` using and without ### Minimal reproduction ```js const fs = require("fs"); fs.writeFileSync(`${__dirname}/t1.cjs`, "module.exports = 1"); console.time(-1); const t = require("./t1.cjs"); console.timeEnd(-1); fs.unlinkSync(`${__dirname}/t1.cjs`); ``` <!-- This link explains why we ask for a minimal reproduction. Thank you in advance! https://gist.github.com/Rich-Harris/88c5fc2ac6dc941b22e7996af05d70ff You can create a reproduction here: https://github.com/TypeStrong/ts-node-repros --> ### Specifications <!-- `ts-node -vv` will print ts-node, node, and TypeScript versions --> * ts-node version: v10.9.2 * node version: v20.16.0 * TypeScript version: v5.6.2 * tsconfig.json, if you're using one: ```json { "compilerOptions": { "allowJs": true, }, } ``` OR ```json {} ``` * package.json: ```json { "devDependencies": { "ts-node": "^10.9.2", "typescript": "^5.6.2" }, } ``` * Operating system and version: MacOS 14.1.2 * If Windows, are you using WSL or WSL2?:
Activity