Skip to content

Extra file (package.json) not included into final zips #315

Closed
@doteric

Description

@doteric

Describe the bug
Extra files (package.json to be exact) are not included into the final zips.

Versions (please complete the following information):

  • OS: Mac
  • Serverless Framework Version: 3.18.2
  • Plugin Version: 1.30.0

Additional context
So basically I wanted to use esbuild with ESM (AWS supports this for a while already). I set the type inside package.json to module and everything else needed for this move, worked fine, but the problem I stumbled upon is that serverless-esbuild simply does not include the package.json into the zip even if it's added to the package.patterns like so below.

custom:
  esbuild:
    bundle: true
    minify: false
    packager: 'yarn'
    target: 'node16'
    keepOutputDirectory: true

package:
  individually: true
  excludeDevDependencies: true
  patterns:
    - 'package.json'

It looks like the .esbuild contains the the package.json, but the zips themselves don't.

Of course I could just name my files .mjs instead, but that isn't an ideal solution for me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingreleased

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions