Closed JuanM04 closed 2 years ago
Can you fork the plugin, setup a repro in the demo folder, and post link here? Thx
https://github.com/JuanM04/vite-tsconfig-paths/tree/repro-59
The second line in main.jsx
has been changed:
- import { Root } from '@/Root'
+ import { Root } from '@/Root.js'
With that setup, when you run pnpm tsc --noEmit
that file doesn't throw an error (others do, but they don't matter in this example), but when you run pnpm build
it throws. If you revert that change, TypeScript throws and Vite doesn't
Duplicate of #54 I think?
With the introduction of ES Modules in TypeScript 4.7, TypeScript needs every import to have an extension. For example, if I have a file
util.ts
, I would need to import it as./utils.js
(so that when transpiles to plain JavaScript, the import works as expected).The addition of a
.js
to an aliased path by the plugin breaks the resolution. For example: