-
-
Notifications
You must be signed in to change notification settings - Fork 532
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
SWC ignore .swcrc config #1856
Comments
What's your |
I try to pure an invalid .swcrc and ts-node start without problems. The configuration is skipped. Is possibile enable swcrc flag (actually swcrc: false) here? Here the error using SWC:
|
Is there a minimal example of the .js file raising this error? |
I cannot provide the example, because the JS lib that I've use is highly obfuscated, so it's difficult extract only the private part. |
It can be a new one, just needs to be an example that can be used to test with. Requesting a minimal reproducible example is common practice in open-source: https://en.wikipedia.org/wiki/Minimal_reproducible_example |
I have the same problem also, any .swcrc config fileis ignored. |
The same here |
Is it really necessary for ts-node to tell swc to ignore |
Slightly different use case here, using the "jsc": {
"paths": {
"@/some/*": ["thing/*"],
}, ts-node could optionally allow specifying these (or fetching them from the |
For what is worth, for a quick patch, changing Diff here: diff --git a/node_modules/ts-node/dist/transpilers/swc.js b/node_modules/ts-node/dist/transpilers/swc.js
index eeddd4f..563c253 100644
--- a/node_modules/ts-node/dist/transpilers/swc.js
+++ b/node_modules/ts-node/dist/transpilers/swc.js
@@ -165,7 +165,7 @@ function createSwcOptions(compilerOptions, nodeModuleEmitKind, swcInstance, swcD
ignoreDynamic: nodeModuleEmitKind === 'nodecjs',
}
: undefined,
- swcrc: false,
+ swcrc: true,
jsc: {
externalHelpers: importHelpers,
parser: { |
I think it's necessary for ts-node to expose the reading behavior of swc, especially since the @swc/[email protected] version was recently updated with the useDefineForClassFields option enabled by default, which has caused inconsistent compilation behavior for class properties compared to tsc. |
Otherwise shall we disable useDefineForClassFields firstly? #1968 |
Also interested in this, same issue with |
uses https://github.com/swc-project/swc-node fixes #792 cannot use ts-node anymore because it doesn't provide an option for .swcrc TypeStrong/ts-node#1856 TODO: depends on swc-project/swc#7358 to actually be used TODO: remove swc-node in examples/simple TODO: move .swcrc write in generate_ts_code.go into central location
Any news? |
Bump - this prevents us from adopting React 17 Transform as we're unable to override |
Also curious |
any news? |
I too would like to use the swc but I have multiple prod/dev .swcrc files that I need to be able to indicate. I have gone ahead and implemented a basic PR, however the yarn version is a blocker for me to install and run tests reliably. This is an easy win as long as someone can either take over writing the tests or can point me to documentation for setting up and running tests reliably. The PR itself should be pretty innocuous since it's only adding an option argument and defaults back to the original settings if it's not provided. |
Desired Behavior
When use ts-node, you should use default swcrc that ts-node create, but if is present a .swcrc file, you should use that file.
Is this request related to a problem?
Yes, because if I have a JS file with private members (hash # char), SWC wont compile
The text was updated successfully, but these errors were encountered: