TypeStrong / dts-bundle

Export TypeScript .d.ts files as an external module definition
MIT License
308 stars 57 forks source link

tsconfig.json paths #69

Open couellet opened 6 years ago

couellet commented 6 years ago

Here's our tsconfig.json file:

{
    "compilerOptions": {
        "sourceMap": true,
        "baseUrl": ".",
        "declaration": true,
        "paths": {
            "@/*": [
                "src/*"
            ]
        },
        "strictNullChecks": true
    }
}

When I generate the bundle, the imports like this one are not working as expected:

import { initSDK } from '@/core';

Looks like dts-bundle doesn't parse our tsconfig.json file. Is there a way to do that?

silkimen commented 5 years ago

Having the same issue.

DavidPeicho commented 5 years ago

You can use a transformer first. Basically, you use ts-transformer-imports to convert your imports into relative path, and then you apply DTS Bundle.