weiran-zsd / dts-cli

Zero-config CLI for TypeScript package development
MIT License
440 stars 23 forks source link

How to use path aliases? #202

Open sarat1669 opened 1 year ago

sarat1669 commented 1 year ago

Current Behavior

tsconfig.json path aliases are not working

Desired Behavior

Path aliases to work

Who does this impact? Who is this for?

People who want to avoid ../../../ hell

Describe alternatives you've considered

Tried solution mentioned in tsdx issues https://github.com/jaredpalmer/tsdx/issues/379#issuecomment-568202209

Additional context

tsconfig.json
{
  ...
  "compilerOptions": {
    "jsx": "react-jsx",
    "esModuleInterop": true,
    "paths": {
      "@uikit/*": ["./src/uikit/*"],
      ...
    }
  }
  ...
}
dist/elemason.esm.js
import { Box as Box$2 } from '@uikit/components';
✘ [ERROR] Could not resolve "@uikit/components"

    ../repositories/elemason/dist/elemason.esm.js:11:1047:
      11 │ ...ent, TextArea as TextArea$2, ToastRoot } from '@uikit/components';
ribastudio commented 7 months ago

i have the same error