I ran into a problem that TypeScript + Webpack does not allow correct dependencies if they are in a symbolic linked folder. I have a file structure:
- main
-- index.ts
-- package.json
-- webpack.config.js
- shared-lib
-- services
-- package.json
In mainthere is a dependency for shared-lib@file:../shared-lib, as a result of npm will create a symbolic link for it in node_modules.
In shared-libI have a dependency for lodash-es, and I also have it in main, but that there should be only one in the project lodash-esthat I want to save in main, as a result, when I try to build a project, I get something like:
ERROR in [at-loader] ../shared-lib/index.ts:1:24
TS2307: Cannot find module 'lodash-es/capitalize'.
Webpack , , node_modules resolve.modules. , TypeScript , . TypeScript , TypeScript, , ? rootDirs, , , .