I am creating an npm package that needs to be able to read config files from the project root. I'm not sure how to do this.
For example,
- Next.js is able to read
./pages/and./next.config.jsfrom the project root - Jest is able to read
./jest.config.jsfrom the project root - ESLint is able to read
./.eslintrc.jsonfrom the project root - Prettier is able to read
./.prettierrc.jsfrom the project root - Typescript is able to read
./tsconfig.jsonfrom the project root - Babel is able to read
./.babelrcfrom the project root
I've tried looking at their source code to see how they do it but the projects are so large that I can't find the relevant section.
How do they achieve this?
from How do node_modules packages read config files in the project root?
No comments:
Post a Comment