agutoli / serverless-layers

Serverless.js plugin implementing AWS Lambda Layers, reducing lambda size, warm-up, and deployment time.
MIT License
229 stars 54 forks source link

Symlink resolution in node_modules #133

Open masayuki-tsuji opened 1 year ago

masayuki-tsuji commented 1 year ago

When deploying with pnpm + monorepo configuration, the zip file is uploaded without resolving the symbolic link path.

Config file.

serverless-layers:
  packageManager: pnpm

Directory structure

.
├── README.md
├── node_modules
├── package.json
├── packages
│   ├── admin
│   ├── app
│   │   ├── config
│   │   │   ├── custom.yml
│   │   ├── node_modules
│   │   │   ├── aws-sdk -> ../../../node_modules/.pnpm/aws-sdk@2.1277.0/node_modules/aws-sdk
│   │   │   ├── body-parser -> ../../../node_modules/.pnpm/body-parser@1.20.1/node_modules/body-parser
│   │   │   ├── compression -> ../../../node_modules/.pnpm/compression@1.7.4/node_modules/compression
│   │   │   ├── lodash.clonedeep -> ../../../node_modules/.pnpm/lodash.clonedeep@4.5.0/node_modules/lodash.clonedeep
│   │   │   ├── lodash.floor -> ../../../node_modules/.pnpm/lodash.floor@4.0.4/node_modules/lodash.floor
│   │   │   ├── lodash.update -> ../../../node_modules/.pnpm/lodash.update@4.10.2/node_modules/lodash.update
│   │   │   ├── nanoid -> ../../../node_modules/.pnpm/nanoid@3.3.4/node_modules/nanoid
│   │   │   └── validator -> ../../../node_modules/.pnpm/validator@13.7.0/node_modules/validator
│   │   ├── package.json
│   │   ├── serverless.yml
│   └── kit
├── pnpm-lock.yaml
├── pnpm-workspace.yaml
└── tsconfig.json

If I set serverless-layers.packageManager to npm, it works fine, but our project uses pnpm and we cannot change it.

We are aware that pnpm is supported in the Issue. https://github.com/agutoli/serverless-layers/issues/76 Please let me know if there is a workaround or if you plan to support it.