Skip to content
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

fix(repl): specify ts loader #46

Merged
merged 2 commits into from
Jun 23, 2022
Merged

Conversation

vaakian
Copy link
Contributor

@vaakian vaakian commented Jun 23, 2022

Problem

TypeScript REPL can't actually execute TypeScript expressions

Reason

It detected a wrong loader(js) because in core-utils that path.extname('.ts') returns an empty string, so it will add a .js suffix to the filePathand then a js loader is detected.

see transform/get-esbuild-options.ts#L35

image

there's also another solution I prefer:
transform(code, 'repl', { loader: 'ts' })

@privatenumber privatenumber changed the title fix(repl): detect ts loader fix(repl): specify ts loader Jun 23, 2022
@privatenumber privatenumber merged commit 2609f2d into privatenumber:develop Jun 23, 2022
@privatenumber
Copy link
Owner

Thanks for catching this & the PR!

@privatenumber
Copy link
Owner

🎉 This PR is included in version 3.5.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants