Closed surfer19 closed 4 years ago
Have you tried npm/yarn link? If I'm understanding your goal they should solve this.
@surfer19 Have you figured out a solution for the above? I'm currently looking at trying to find a way to achieve this same setup. So far I've tried:
ModuleScopePlugin
from config-override.js
and using relative imports from project-main
to project-module1
resolve.alias
mappings for project-module1
to project-main
config-override.js
fileAny thoughts or suggestions around this would be awesome! I've even given some thought to trying out babel macros to preprocess project-module*
and handle transpiling there but I fear that would lose out on HMR potentially and for my use-cases here I'd really love to keep that.
@cbourdage Well, you can go for yarn link solution but I don’t recommend it while it’s not easy maintainable dependency approach. Try to search for micro-front end approach, if it fits for you. You could wrap every module to web component and include it in runtime. Doesn’t matter if module is written in angular, react or whatever. Even more Easy check framework for that. https://single-spa.js.org/
Idea of this approach is to create completely separate modules that doesn’t share data between themself. Passing data down main-project->module is allowed.
hey, I have 3 projects(separate repositories):
project-main
: using react-app-rewired (typescript version)project-module1
: different react repo (also ts)project-module2
: different react repo (also ts)project-module1
andproject-module2
are linked with yarn toproject-main
and creates bundle inside of main project with ts compiler.Current solution:
What I want to achieve:
Basically I need to get rid of part where modules compiles themselves to main project and instead that connect them somehow to main repository compiler in real time. So whenever there will be local code change in folders
project-module1
orproject-module2
, change will be automatically reflected on localhost. There is also idea connectproject-main
server to modules servers but I think it would be extremely complicated. What do you think please?