-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
feat(relay): Add outputFileExtension
option
#222
Merged
kdy1
merged 27 commits into
swc-project:main
from
JulienKode:fix/does-not-specify-import-path
Oct 25, 2023
Merged
feat(relay): Add outputFileExtension
option
#222
kdy1
merged 27 commits into
swc-project:main
from
JulienKode:fix/does-not-specify-import-path
Oct 25, 2023
+176
−40
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JulienKode
changed the title
fix: does not specify import path when transpiling relay imports
feat: add outputFileExtension to specify which output extension to use
Oct 24, 2023
JulienKode
changed the title
feat: add outputFileExtension to specify which output extension to use
feat: add Oct 24, 2023
outputFileExtension
to specify which output extension to use
JulienKode
changed the title
feat: add
feat(relay): add Oct 24, 2023
outputFileExtension
to specify which output extension to useoutputFileExtension
to specify which output extension to use
kdy1
approved these changes
Oct 25, 2023
kdy1
changed the title
feat(relay): add
feat(relay): Add Oct 25, 2023
outputFileExtension
to specify which output extension to useoutputFileExtension
option
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Feature
In this PR we add
outputFileExtension
parameter in the config that can be:ts
js
undefined
When it's undefined we do the same behaviour as now which is controlled by
language
parameterWhen it's configured we use the
outputFileExtension
parameter to specify which extension to use in the transpiled path importExample of usage:
Initial issue
We are migrating from
babel
toswc
and currently our babel pluginThe output in dist are javascript esm and instead of having this
we have this:
Basically it add
.ts
at the end but our files are javascript transpiled filesplugins/packages/relay/src/lib.rs
Line 42 in 91fabf8
.ts
at the end:plugins/packages/relay/transform/src/lib.rs
Line 165 in 91fabf8
Is it a configuration issue on our side or a plugin issue that by default transpilation import path should not have extensions ? If it's a configuration issue sorry in advance I thought the inputs were the same as the babel plugin
If we consider it as a bug I'll obviously fix this PR and update test, otherwise I'll close it and change the config on my side
Swc config:
previous babel config for relay:
Note: We cannot put
javascript
language type as our input files aretypescript
found by @narajaon