VS Code is not inferring the correct typings. I tested the following configuration by
manually changing the installed package inside node_modules.
It works now.
"exports": {
".": {
"types"./types/fleetbase.d.ts", // <-- THIS IS THE MISSING PIECE!
"import": "./dist/esm/fleetbase.js",
"require": "./dist/cjs/fleetbase.js"
}
},
// And possibly keep the top-level for older TS versions/tooling:
"types": "./dist/types/fleetbase.d.ts",
VS Code is not inferring the correct typings. I tested the following configuration by
manually changing the installed package inside node_modules.
It works now.
package.json