2

currently we're using multiple yarn 1.x projects to deploy code to aws.

to export the dependencies for lambda-layers we're currently using
yarn install --production --modules-folder layer/nodejs/node_modules

now we'd like to migrate to yarn berry to utilise local package references, however the --modules-folder option does not exist anymore.

Is there a way to archive the same thing with yarn berry?

for context, this is my .yarnrc file:

nmHoistingLimits: workspaces

nodeLinker: node-modules

plugins:
  - path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs
    spec: "@yarnpkg/plugin-typescript"
  - path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
    spec: "@yarnpkg/plugin-workspace-tools"

yarnPath: .yarn/releases/yarn-berry.js

jaecktec
  • 440
  • 4
  • 15
  • did you ever manage to find a solution to this / migrate to Berry? – MrChrisRodriguez Dec 03 '21 at 05:02
  • 1
    so they said it is not and will never be supported, however I could solve my problem by using esbuild. It bundles all your dependencies into one file that you can execute. Perfect for the lambda use-case. – jaecktec Dec 04 '21 at 11:54
  • 1
    another learning: when using npm workspaces it's possible to run: `npm -w @foo/lambda --omit=dev ls --depth=9999 --parseable` this gives a list of prod dependencies. Should be pretty easy to build a script from there on that copies and zips them – jaecktec Jul 21 '22 at 09:48

0 Answers0