simonhaenisch / rollup-plugin-typescript-paths

Rollup Plugin to automatically resolve path aliases set in the compilerOptions section of tsconfig.json.
https://npmjs.com/rollup-plugin-typescript-paths
MIT License
43 stars 12 forks source link

Enable use with non-transpiled TS #8

Closed Benjozork closed 3 years ago

Benjozork commented 3 years ago

Use case

We run our build using sucrase to transpile TS without type-checking (and rely on editors and ESLint to provide typing errors). This plugin is very useful as sucrase does not perform path substitution - however, it assumes every resolved path needs to have its extension replaced with .js (see this line) - which is not the case, since those imports are then transpiled by sucrase anyway.

This causes sucrase to not find the imported modules, since the modules are still present in .tsx? form

Proposal

Provide an option to disable extension substituion with .js.