I've got a monorepo which uses Lerna to publish to NPM.
- root
- packages/componentB
- packages/componentA
- packages/all-components
I want to avoid building every single component everytime and thought
can I not store the packages/compoent/dist in cache
but when i set the path:
image: node:20
definitions:
caches:
build-cache:
key:
files:
- lerna.json
path: packages/**/dist
..
pipelines:
pull-requests:
"**":
- step:
name: "Build divergent"
caches:
- build-cache
script:
- node_modules/.bin/lerna run build --since=origin/main
artifacts:
- packages/**/dist
the dist/* get sqashed into a single folder without the filestructure so Iit cannot access any package/ * / dist files
if I download the artifacts this is what it looks like, the build builds the divergent but then errors as it cannot find the rest that is inside the ** folder

Am i doing it wrong?