Closed g-wozniak closed 1 year ago
Having updated @swc-node/register to v1.5.6 SWC stopped transpiling module aliases where the exact same setup works without issues for v1.5.4.
@swc-node/register
v1.5.6
v1.5.4
Structure:
src/app.ts
src/properties.ts
My app.ts:
app.ts
import {LogCategories} from '@root/properties' console.log(LogCategories.dummy)
My properties.ts:
properties.ts
export enum LogCategories = { dummy = 'dummy' }
My tsconfig.json:
tsconfig.json
{ "compilerOptions": { "baseUrl": "./", "outDir": "./.build", "target": "ES2021", "esModuleInterop": true, "paths": { "@root/*": ["src/*"] }, "moduleResolution":"node" }, "exclude": [ "node_modules" ] }
My .swcrc:
.swcrc
{ "test": ".ts$", "jsc": { "parser": { "syntax": "typescript", "tsx": false, "decorators": false, "dynamicImport": true }, "target": "es2021" }, "module": { "type": "commonjs" } }
My execution command: node --inspect=7777 -r @swc-node/register ./src/app.ts
node --inspect=7777 -r @swc-node/register ./src/app.ts
Error message I am getting in 1.5.6: Error: Cannot find module '@root/properties'
Error: Cannot find module '@root/properties'
Other dependencies:
Have you encountered similar issue or able to advise what may cause it?
Maybe relate with: https://github.com/swc-project/swc/pull/6930
@Brooooooklyn Sorry, forgot to mention, it's Mac OS, WebStorm.
Having updated
@swc-node/register
tov1.5.6
SWC stopped transpiling module aliases where the exact same setup works without issues forv1.5.4
.Structure:
src/app.ts
src/properties.ts
My
app.ts
:My
properties.ts
:My
tsconfig.json
:My
.swcrc
:My execution command:
node --inspect=7777 -r @swc-node/register ./src/app.ts
Error message I am getting in 1.5.6:
Error: Cannot find module '@root/properties'
Other dependencies:
Have you encountered similar issue or able to advise what may cause it?