You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Operating System:
Platform: darwin
Arch: arm64
Machine Type: arm64
Version: Darwin Kernel Version 23.1.0: Mon Oct 9 21:32:11 PDT 2023; root:xnu-10002.41.9~7/RELEASE_ARM64_T6030
CPU: (11 cores)
Models: Apple M3 Pro
Binaries:
Node: 18.17.0
npm: 9.6.7
Yarn: 1.22.19
pnpm: 8.14.2
Relevant Packages:
@swc/core: 1.4.2
@swc/helpers: N/A
@swc/types: N/A
typescript: 5.3.3
SWC Config:
output: N/A
.swcrc path: N/A
Next.js info:
output: N/A
Expected behavior
It should resolve the path for the baseUrl folder and should not resolve the path for the parent folder.
import{foo}from"./src/foo";// based on current dirconsole.log(foo,bar);
Actual behavior
If pass process.cwd() as baseUrl to swc transform, it resolves the path as the parent folder.
Also, it does not resolve the path for the baseUrl folder.
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Describe the bug
SWC
transform
requires thebaseUrl
to be absolute path.The common case is to use
resolve
to get the absolute path resolving thecwd
andbaseUrl
.For the following examples, I'm using
process.cwd()
as resolvedbaseUrl
.If pass
process.cwd()
asbaseUrl
toswc
transform, it resolves the path as the parent folder.It should resolve the path for the
baseUrl
folder and should not resolve the path for the parent folder.Input code
Config
No response
Playground link (or link to the minimal reproduction)
https://github.com/devjiwonchoi/repro-swc-base-url-paths
SWC Info output
Expected behavior
It should resolve the path for the
baseUrl
folder and should not resolve the path for the parent folder.Actual behavior
If pass
process.cwd()
asbaseUrl
toswc
transform, it resolves the path as the parent folder.Also, it does not resolve the path for the
baseUrl
folder.Version
1.4.2
Additional context
jsc.paths
are not relative tojsc.baseUrl
#2725, but added a valid reproduction and confirming the latest version.The text was updated successfully, but these errors were encountered: