monorepo-example icon indicating copy to clipboard operation
monorepo-example copied to clipboard

Move common config files to root

Open miltoneiji opened this issue 6 years ago • 2 comments

Typescript and jest config files are very similar between the packages. Move them to root and extend them in the packages.

miltoneiji avatar Jan 10 '19 01:01 miltoneiji

Figure a way to:

  • [ ] have a nice output when executing tests from root
  • [ ] the possibility to execute tests from inside a package

miltoneiji avatar Jan 12 '19 13:01 miltoneiji

thank you for your great example. I stumbled across it looking for a solution why my tests fail, when they reference to a other package. My solution, with jest as a test runner, was to use ```

moduleNameMapper: {
    '@foo': '<rootDir>/../../packages/foo/src/'
}

https://jestjs.io/docs/en/configuration.html#modulenamemapper-objectstring-string--arraystring

Hope this may help people coming across here too. It enabled me to run tests within a package or on root level, without having to build sources beforehand

sthuber90 avatar Apr 14 '20 13:04 sthuber90