rollup / plugins

šŸ£ The one-stop shop for official Rollup plugins
MIT License
3.57k stars 567 forks source link

(@rollup/plugin-typescript) Cannot import typescript file from parent folder (../script) without .ts file extension (../script.ts) #1700

Open danielFHcode opened 3 months ago

danielFHcode commented 3 months ago

Expected Behavior

When bundling folder/script2.ts (from inside folder) rollup should be able to understand that import {helloWorld} from '../script1' refers to ../script1.ts, and bundle it with no errors.

Actual Behavior

I get this error:

[!] RollupError: Could not resolve "../script1" from "script2.ts"
script2.ts
    at getRollupError (/home/projects/stackblitz-webcontainer-api-starter-751pte/folder/node_modules/rollup/dist/shared/parseAst.js:282:41)
    at Object.error (/home/projects/stackblitz-webcontainer-api-starter-751pte/folder/node_modules/rollup/dist/shared/parseAst.js:278:42)
    at ModuleLoader.handleInvalidResolvedId (/home/projects/stackblitz-webcontainer-api-starter-751pte/folder/node_modules/rollup/dist/shared/rollup.js:20000:36)
    at eval (/home/projects/stackblitz-webcontainer-api-starter-751pte/folder/node_modules/rollup/dist/shared/rollup.js:19960:26)

Additional Information

This problem does not acre:

For all of these reasons I believe that this is a bug and not an intended feature.