I have a local lib with a few submodules, I added dynamically a package.json in the dist folder to tell which files I want to expose using "exports".
What I can't figure out is why typescript gives me this error:
"minimal-module-webpack/omega" is a submodule of "minimal-module-webpack" and should resolve to the omega.js. Here is the package.json placed inside the dist folder:
{
"main": "./index.js",
"exports": {
"./omega": "./omega.js",
"./beta": "./beta.js",
"./alpha": "./alpha.js"
}
}
The same from an webpack project with js:
So what could I have been missing here? why this works with js but ts compiler is complaining? Even if I remove the package.json from the dist and use the exports in the root of the lib pointing to the dist tsc still complains.