floydspace / serverless-esbuild

💨 A Serverless framework plugin to bundle JavaScript and TypeScript with extremely fast esbuild
MIT License
445 stars 137 forks source link

pnpm: external modules bundled without their nested modules. #509

Open UROjQ6r80p opened 10 months ago

UROjQ6r80p commented 10 months ago

External modules are bundled without their dependencies.

Example serverless.yml:

custom:
  esbuild:
    packager: pnpm
    external:
      - '@sparticuz/chromium'

module @sparticuz/chromium has dependencies:

  "dependencies": {
    "follow-redirects": "^1.15.3",
    "tar-fs": "^3.0.4"
  }

They are not included after command pnpm exec serverless package: image

To Reproduce Minimal repo to reproduce: https://github.com/UROjQ6r80p/serverless-esbuild-pnpm-no-nested-dependencies/tree/main

Expected behavior Dependencies of modules to be bundled together.

Versions (please complete the following information):

dvictory commented 10 months ago

+1

floydspace commented 10 months ago

hey @dvictory thank you for raising it, currently, pnpm is not really reliable, so please keep an eye on this issue https://github.com/floydspace/serverless-esbuild/issues/506 it addresses that pnpm support must be adjusted

mokone91 commented 3 months ago

+1