I'm trying to determine how to switch our projects and libraries in a typescript monorepo using npm workspace. After some coding on a test structure I've been able to obtain an unsustifying working solution. The project structure is like this one:
Workspace -+-- source(SuperApplication)
|-- ApplicationA
|-- ApplicationB
| ...
|-- ApplicationN
|-- Local_library1
|-- Local_library2
| ...
+-- Local_libraryN
I have applications that depends on shared libraries. So every package.json contains something like:
...
"main": "./dist/esm/xx.js",
"module": "./dist/esm/xx.js",
"types": "./dist/typings/xx.d.ts",
...
"dependencies": {
"@company/local_libraryX": "file:packages/X",
"@company/local_libraryY": "file:packages/Y",
...
"@company/local_libraryZ": "file:packages/Z"
}
...
While the tsconfig.json contains:
...
"incremental": true,
"composite": true,
...
The super application is a simple application that helps the user choosing the application he needs.
Actually every application has his own webpack config (due to the previous way of working)
Unfortunately I've not been able to let HMR working when I make changes on dependencies and I need to rebuild/reload every time. I'm looking for a way take advantage of HMR while making changes in every application/library. I did not post any code because I think it's something due to a misconfiguration, is there any one who can give me some advice?