justkey007 / tsc-alias

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

Few files affected on second run #181

Open Soviut opened 1 year ago

Soviut commented 1 year ago

My build looks like

tsc --project tsconfig.build.json && tsc-alias -p tsconfig.build.json

The tsconfig.build.json extends tsconfig.json to exclude tests.

In my tsconfig.json I have the following config

{
  "compilerOptions": {
    ...
    "baseUrl": ".",
    "paths": {
      "@/*": ["src/*"],
    }
  },

  "tsc-alias": {
    "verbose": true,
    "resolveFullPaths": true
  }
}

When I delete my /dist directory and run npm run build I get a verbose message saying

tsc-alias info: 89 files were affected!

However, if I re-run npm run build with the existing /dist directory still there, I get

tsc-alias info: 86 files were affected!

And if I do the following on an existing build where I can see the aliases haven't been converted

$ npx tsc-alias
tsc-alias info: 0 files were affected!

Why are fewer files being processed the 2nd time when the /dist directory still exists?