We are trying to create an npm package, that's the base for most of our projects, but we're having some issues with the following:
the index.d.ts
of our base npm package looks like the following:
export * from './src/core';
declare module '*.html' {
const template: string;
export default template;
}
the top line works great, we have access to our modules in the core folder, however the second part, doesn't work.
but if we place the same code in custom.d.ts
in our own project, the import for html files works great.
the package.json
(some parts are removed) looks like following:
{
"version": "0.0.0",
"license": "ISC",
"main": "dist/main.bundle.js",
"module": "./index.js",
"types": "./index.d.ts",
"engines": {
"node": ">= 6.0.0",
"npm": ">= 3"
}
}
folder structure:
app/
├── node_modules/
| └── base/
│ ├── src/
│ | └── core/
│ | └── ....
│ └── index.d.ts
├── src/
│ └── ...
└── custom.d.ts