jsx file, it will walk up looking for a package.json to see whether that file is an ES module, and use that to determine: To overlay the way TypeScript works in this system. CommonJS modules get imported under certain special rules.certain global-like values like require() and _dirname cannot be used directly.imports might resolve differently from dependencies in node_modules.relative import paths need full extensions (e.g we have to write import "./foo.js" instead of import "./foo").import/ export statements and top-level await can be used.When a file is considered an ES module, a few different rules come into play compared to CommonJS: d.ts files are interpreted as ES modules or CommonJS modules, and defaults to CommonJS when not set.
0 Comments
Leave a Reply. |