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.

lerna bootstrap links whole folder, even if files and main are specified

See original GitHub issue

Expected Behavior

I’ve tried to exclude the src, test and node_modules folder from the linked package. I’ve tried adding them to a .npmignore file and adding the files to the main and files property of the package.json (in each subproject)

package.json includes: Screen Shot 2019-10-16 at 18 00 01

linked package looks like this however: Screen Shot 2019-10-16 at 18 00 08

Current Behavior

Lerna copies the whole folder, including the node_modules, src and test folder

lerna.json

{
    "packages": [
        "packages/*",
        "services/*"
    ],
    "version": "0.0.0",
    "npmClient": "npm"
}

lerna-debug.log

Your Environment

Executable Version
lerna --version 3.18.1
npm --version 6.9.0
yarn --version -
node --version 10.16.3
OS Version
macOS Catalina 10.15

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
evocateurcommented, Dec 27, 2019

@cevr I linked to the docs earlier:

You’re probably looking for pkg.publishConfig.directory (or --contents if it’s global).

I don’t personally use lerna bootstrap, so your guess is as good as mine.

1reaction
evocateurcommented, Oct 18, 2019

@UnchartedBull And actually, I don’t quite understand what your problem is? Linking to the directory where the package.json lives with the "main": "dist/index.js" is exactly what should be happening (even when transpiling your source). Unless you’re trying to do complicated angular/typescript crap, then yeah, --contents or pkg.publishConfig.directory is what you want.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Manage Monorepos With Lerna - DigitalOcean
Run the following command to bootstrap your npm packages from your project root folder: lerna bootstrap.
Read more >
node.js - Is there a way to specify different paths for the same ...
You could do this with lerna which is a mono-repository CLI tool. First of all, you would have to define multiple projects within...
Read more >
Getting Started | Lerna
To get started with the tutorial, clone this repository. The main branch contains the final setup. If you want to follow along, please...
Read more >
A Beginner's Guide to Lerna with Yarn Workspaces | by jsilvax
Let's add yarn as our npmClient and specify that we're using yarn workspaces. For this tutorial we'll be versioning our packages independently.
Read more >
Managing Your Typescript Monorepo With Lerna and Codefresh
Several companies have set-up their repositories as Monorepos, ... This will create a Lerna configuration file and a package folder, as well ...
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