Open Pavel-Boyazov opened 1 month ago
Slow import Long time import
Speed regardless of the indication of allowJs
allowJs
Import without allowJs option takes about 0.5 ms Import with allowJs option is true takes about 43 ms
true
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`);
{ "compilerOptions": { "allowJs": true, }, }
OR
{}
{ "devDependencies": { "ts-node": "^10.9.2", "typescript": "^5.6.2" }, }
Search Terms
Slow import Long time import
Expected Behavior
Speed regardless of the indication of
allowJs
Actual Behavior
Import without
allowJs
option takes about 0.5 ms Import withallowJs
option istrue
takes about 43 msSteps to reproduce the problem
allowJs
using and withoutMinimal reproduction
Specifications
OR