how to ignore folders in melos packages

1k Views Asked by At

working in a monorepo with this structure

monorepo/
  examples/
    # ...
    foo/
  packages/
    # ...
    foo/
      # ...
      example/ -> examples/foo/

where the example in packages/foo
is a deep link to examples/foo/
that contains a demo app called foo_example

I'm encountering a problem during melos bootstrap

Run melos bootstrap
melos.yaml: Multiple packages with the name `foo_example` found in the workspace, which is unsupported.
To fix this problem, consider renaming your packages to have a unique name.

The packages that caused the problem are:
- foo_example at packages/foo/example
- foo_example at examples/foo

Error: Process completed with exit code 1.

I would like to keep the folders for examples and packages separated
while providing an example readily available for https://pub.dev/

is there a way to exclude the packages/**/example/ folders from melos?

this is how I'm pointing at the packages right now

name: <my_mono_repo>

packages:
  - examples/**
  - packages/**

scripts:
 # ...

1

There are 1 best solutions below

0
On BEST ANSWER

always read the docs :) https://melos.invertase.dev/configuration/overview#ignore

this does the job

ignore:
  # e.g. ignore example apps
  - "packages/**/example"