-
Notifications
You must be signed in to change notification settings - Fork 401
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(cli): Resolve jsc.baseUrl
before calling @swc/cli
#2245
Conversation
Outstanding job on creating SWC, @kdy1! |
@kamilmysliwiec any plans on releasing this? Been waiting on it before enabling SWC in all our projects 😃 |
Just published as 10.1.13 |
With version '10.1.14', the problem remains in default example
|
|
maybe we can lock swc/core version? |
Note: You can lock in your app. |
In my scene lock version is difficult, if the problem belong to nestjs, we should fix it in nest |
@kdy1 should |
It should be absolute. It does not start with |
I'm not sure why the first slash is removed. |
Let me investigate. I'll create a follow-up PR shortly! |
Yeah, |
Fixed deddb98, published as 10.1.15 |
Cool! Thank you! |
With nestjs/cli@10.1.16, the default example remain throw error $ nest new project-name
$ cd project-name && yarn && yarn add @swc/cli @swc/core
$ npx nest start -b swc
> SWC Running...
Successfully compiled: 5 files with swc (14.93ms)
Error: Cannot find module 'src/app.module'
Require stack:
- /Users/yuuang/Desktop/project-name/dist/main.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1026:15)
at Function.Module._load (node:internal/modules/cjs/loader:871:27)
at Module.require (node:internal/modules/cjs/loader:1098:19)
at require (node:internal/modules/cjs/helpers:108:18)
at Object.<anonymous> (/Users/yuuang/Desktop/project-name/dist/main.js:6:20)
at Module._compile (node:internal/modules/cjs/loader:1196:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1250:10)
at Module.load (node:internal/modules/cjs/loader:1074:32)
at Function.Module._load (node:internal/modules/cjs/loader:909:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) |
PR Checklist
Please check if your PR fulfills the following requirements:
This is an implicit bugfix.
PR Type
What kind of change does this PR introduce?
What is the current behavior?
@nest/cli
does not resolvejsc.baseUrl
even though it readsjsc.baseUrl
from.swcrc
.See swc-project/swc#7827 for the reason that
@swc/core
cannot resolvejsc.baseUrl
if it's not coming from.swcrc
Issue Number: N/A
What is the new behavior?
It's resolved from the directory of
.swcrc
, if exists, and the project root (I guess?) if not.Does this PR introduce a breaking change?
Other information
I'm author of the SWC project