Currently, I am operating within a pnpm workspace environment. The directory structure is set up in the following manner:
PNPM-WORKSPACE
lib/package.json
lib/generated/a.js
app/tsconfig.json
app/src/b.js
Within the package.json file located in the library I am importing, there is a modification that alters the export path of the folder to eliminate the generated folder name where the generated code resides.
"exports": {
"./*": "./generated/*.js"
},
Therefore, when importing a.js
, which should normally be lib/generated/a
, it becomes lib/a
.
In order to ensure compatibility with Typescript and VS Code, I have included a path in the tsconfig.json
file under the app
section.
paths: {
"lib/*": ["node_modules/lib/generated/*]
}
Although this method functions correctly, the autocomplete feature in VS Code does not work as expected. It continues to suggest lib/generated/a
, which is now an invalid path. Do you have any suggestions on how to resolve this issue? Despite researching several articles, I have yet to find a solution. Thank you in advance for your help.