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
jsc.paths didnt work when file is not on root #2126
Comments
Seems like duplicate of #2050 |
@kdy1 sure thanks apologies i didnt see it, |
@kdy1 this works if you set by the way uses This does not work {
"jsc": {
"parser": {
"syntax": "typescript"
},
"target": "es2020",
"baseUrl": ".",
"paths": {
"@print/a": [ "./packages/a/src/index.ts" ]
}
},
"module": {
"type": "commonjs"
}
} This will works {
"jsc": {
"parser": {
"syntax": "typescript"
},
"target": "es2020",
"baseUrl": "./src",
"paths": {
"@print/a": [ "../packages/a/src/index.ts" ]
}
},
"module": {
"type": "commonjs"
}
} |
@kdy1 another thing is if you set the |
@kdy1 I know now, the for example |
@aelbore Current implementation uses |
swc_ecma_loader: - `TsConfigResolver`: Use `baseUrl` on exact match while resolving. (Closes #2126) swc_ecma_transforms_module: - Add `import_rewriter`. - `NodeImportResolver`: Don't strip extension if it's a directory. (Closes #2269) - `NodeImportResolver`: Don't strip extension if it's not `.ts`, `.js` nor `.tsx`. swc: - Use `import_rewriter`. (Closes #1943, Closes #2523) - Update test (Closes #2715)
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
jsc.paths didnt work when file is not on root folder
Input code
File =>
packages/a/src/index.ts
code =>
File =>
src/index.ts
File =>
package.json
Error
Config
Expected behavior
A clear and concise description of what you expected to happen.
Should work properly and recognise the paths
Version
The version of @swc/core: 1.2.80
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: