Skip to content

Add barrel export #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 26, 2025
Merged

Add barrel export #2

merged 2 commits into from
Jan 26, 2025

Conversation

cefn
Copy link
Owner

@cefn cefn commented Jan 26, 2025

This modification (to add barrel exports) emphasises that there was still a failing in the bundling and resolution strategy. The previous solution only got the NextJS bundling process as far as the .ts files, and the stupidity of the convention to require .js files was defeating the bundler's attempts to resolve source.

See microsoft/TypeScript#49083 (comment) for the original intransigent position taken by the Typescript team and then see microsoft/TypeScript#59767 for when they (very recently) saw the light!

This means we can add .ts file paths in imports, assuming we add the following to our tsconfig.json compilerOptions

    "allowImportingTsExtensions": true,
    "rewriteRelativeImportExtensions": true

@cefn cefn force-pushed the add-barrel-export branch from 81189c4 to 0f850eb Compare January 26, 2025 17:11
@cefn cefn merged commit f0cba68 into main Jan 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant