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

An option to change the translated file's extension #20

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

glebfrank
Copy link

@glebfrank glebfrank commented Jul 3, 2020

When transpiling a .ts, .jsx, or .tsx file, the resulting file's extension normally gets changed to .js (e.g., the input is in typescript, but the output is in plain javascript.) This plugin currently leaves the extension as is. I am proposing an option to set the translated files' extensions to a given string, e.g. "js".

@glebfrank glebfrank changed the title An option to change the translated file An option to change the translated file's extension Jul 3, 2020
if (babelMojo.getTargetFileExtension() != null)
targetFileName = targetFileName.replaceFirst("\\.[^./]+$", "."+babelMojo.getTargetFileExtension());

return babelMojo.getTargetDir().toPath().resolve(relativePath).resolve(targetFileName);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor thing, please use brackets for if statement.
Could you introduce some tests for this? Thanks!

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.

2 participants