Im not sure why but typescript cannot find my declaration file even though I have one. Can anyone see why this is?
My project structure:
scr
- main.ts
- dec.d.ts
str-utils
- index.js
The import:
import {strReverse, strToLower} from '../str-utils/index.js'
My declaration file (dec.d.ts):
declare module "str-utils"
My typescript config:
{
"compilerOptions": {
"module": "commonjs",
"noImplicitAny": true,
"removeComments": true,
"preserveConstEnums": true,
"sourceMap": false,
"outDir": "dist"
},
"include": [
"src/**/*",
"src/dec.d.ts"
],
"exclude": [
"node_modules",
"**/*.spec.ts"
]
}
Can anyone see what I am doing wrong here?