Project structure:
- packages
- front
- library
The library tsconfig.json
{
"include": [
"**/*.js",
"additional-types.d.ts"
],
"exclude": [
"**/*-test.js",
"node_modules"
],
"compilerOptions": {
"moduleResolution": "node",
"allowJs": true,
"declaration": true,
"emitDeclarationOnly": true,
"skipLibCheck": true,
"module": "AMD",
"outFile": "global.d.ts",
}
}
The generated file is then imported in the front package via:
/// <reference types="@Company/library/global" />
The issue is that the declaration paths are not right:
declare module "libraries/utils/generateFrontPath/index" {
// ...
}
Instead of:
declare module "@Company/library/libraries/utils/generateFrontPath" {
// ...
}
The package name (@Company/library
) is missing and there is a /index
at the end that shouldn't be there.
How can I fix this?