A Rollup plugin that resolves TypeScript files when imported with a .js extension and handles extra .js extensions (e.g., importing './file.js' to resolve './file.ts'). v1.2.6 stable, maintained with infrequent releases. Key differentiator: solves the common TypeScript issue of bundlers failing to resolve .js imports that point to .ts source files, useful in monorepos or mixed TS/JS codebases. Requires Node.js >=12 and Rollup >=2.0.
npm install rollup-plugin-js-importsVerified import paths — ran on the pinned version, not inferred.
Basic Rollup config enabling .js import resolution for .ts files.
Upgrade Rollup to v2 or later.
Use additional plugins (e.g., @rollup/plugin-babel) for other extensions.
Use with @rollup/plugin-typescript or tsc.
Use ESM import: import jsImports from 'rollup-plugin-js-imports'
Use jsImports() without .default