question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

support loading config from a parent folder (monorepo)

See original GitHub issue

Hi @egoist!

My project structure has:

+-- project
    +-- packages
    |   +-- library
    +-- tsup.config.ts

When I call tsup from the library folder, it fails to find the config file. I see you’re setting joycon’s stopDir to the current project’s folder:

https://github.com/egoist/tsup/blob/405e165ef7412adf54b9a83248144daa4c13be04/src/load.ts#L44-L55

Would you have any objection to changing that and allow resolve() to traverse the filesystem upward?

export async function loadTsupConfig(cwd: string) {
  const configJoycon = new JoyCon()
  const configPath = await configJoycon.resolve(
    [
      'tsup.config.ts',
      'tsup.config.js',
      'tsup.config.cjs',
      'tsup.config.mjs',
      'tsup.config.json',
      'package.json',
    ],
-   cwd,
-   path.dirname(cwd)
+   cwd
  )

Thanks!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
github-actions[bot]commented, Nov 25, 2021

🎉 This issue has been resolved in version 5.10.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

1reaction
github-actions[bot]commented, May 5, 2022

🎉 This issue has been resolved in version 5.12.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can Eslint specify configuration under child package with ...
So the reason why ESLint is accessing an ".eslintrc.json" file located in a parent folder is simply because that is the default behaviour....
Read more >
Config Files - Babel
New in Babel 7.x, Babel has a concept of a "root" directory, ... See the monorepo documentation for examples of how to use...
Read more >
A Guide to Monorepos for Front-end Code - Toptal
A monorepository is a code management and architectural concept whereby you keep all your isolated bits of code in one super repository instead...
Read more >
Visual Studio Code tips for monorepo development with Multi ...
Multi-root workspaces contain settings that work on a global level and can be overwritten with another settings.json inside its own project ...
Read more >
Monorepo testing using jest projects - Orlando Bayo Adeyemi
Based on my monorepo's jest.config.js configuration above, jest looks for jest.config.js files in my packages directory and sets up the parent ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found