Say I have following project structure (Well its more complex than below structure):
- CommonComponents
- CommonComponentA
- CommonComponentB
- package.json
- webpack.config.js
- .babelrc
- ModuleA
- ComponentC //import CommonComponentA
- ComponentD
- package.json
- webpack.config.js
- .babelrc
- ModuleB
- ComponentE //import CommonComponentB
- ComponentF
- package.json
- webpack.config.js
- .babelrc
I compile, bundle and utilize ModuleA and ModuleB separately. When I switched to babel 7, importing modules from CommonComponents directory stopped working. Babel ignores files which are outside current working directory and doesn't transpile them so webpack compilation fails complaining 'Unexpected token' at imported component.
From what I have understood so far, they have changed the way .babelrc lookup happens. I really can't wrap my head around the terms 'root', 'babelrcRoots', etc. Can someone explain what I will need to do in order to compile ModuleA and ModuleB succesfully from their respective working directory ?