justkey007 / tsc-alias

Replace alias paths with relative paths after typescript compilation
MIT License
875 stars 63 forks source link

Aliasing root directory is not working #217

Open dvqc opened 4 months ago

dvqc commented 4 months ago

tsc-alias is not resolving aliased root directory defined in tsconfig.json paths parameter. I tried different versions of typescript and tsc-alias and it didn't work.

tsconfig.json :

{
    "compilerOptions": {
        "target": "es6",
        "module": "commonjs",
        "outDir": "./build",
        "strict": true,
        "esModuleInterop": true,
        "skipLibCheck": true,
        "isolatedModules": true,
        "forceConsistentCasingInFileNames": true,
        "moduleResolution": "node",
        "baseUrl": ".",
        "paths": {
            "#/*": [
                "./*"
            ]
        }
    },
    "tsc-alias": {
        "resolveFullPaths": true,
        "verbose": false
    },
    "exclude": [
        "node_modules",
        "build"
    ]
}
lozyue commented 3 months ago

I was in trouble as the same. After 1 hour trying, I solved it by simplely removing the "tsc-alias" config in tsconfig.json. It seem that when this config added, tsc-alias will jump all of the files. What an odd behavior!

dvqc commented 3 months ago

I was in trouble as the same. After 1 hour trying, I solved it by simplely removing the "tsc-alias" config in tsconfig.json. It seem that when this config added, tsc-alias will jump all of the files. What an odd behavior!

@lozyue I tried removing tsc-alias from tsconfig as you mentioned but still got unresolved paths when compiling.