Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

if a function has an artifact set, webpack still create it's own #1443

Open
hcbd opened this issue Apr 19, 2023 · 0 comments
Open

if a function has an artifact set, webpack still create it's own #1443

hcbd opened this issue Apr 19, 2023 · 0 comments

Comments

@hcbd
Copy link

hcbd commented Apr 19, 2023

This is a Bug Report / Question

Description

The plugin seems to ignore artifacts that are set inside a individual function in the serverless.yml.
It still creates it's own artifact and uploads this, which is not the expected behaviour.
In my case the artifact is to massive for an lambda@edge function; max 10Kb

Is there a way to use the set artifact and not create/pack one or this a Bug?

Configs

serverless.yml

webpack:
    includeModules:
      forceExclude:
        - aws-sdk
        - core-node-sdk
  
plugins:
  - "@silvermine/serverless-plugin-cloudfront-lambda-edge"
  - serverless-webpack
  - serverless-latest-layer-version
  - serverless-deployment-bucket

package:
  individually: true
  patterns:
    - "!node_module/**"

functionLambdaAtEdge:
  ...rest
  package:
    artifact: 'path-to-some-artifact-file.zip'  # my special artifact which is 1Kb
    individually: true
  lambdaAtEdge:
    distribution: myCloudfront
    eventType: 'origin-request'

function2:
  name: function2
  package: # not set

webpack.config.js

module.exports = {
  mode: slsw.lib.webpack.isLocal ? "development" : "production",
  entry: slsw.lib.entries,
  ..rest

verbose out of config:

Packaging
Using configuration:
{
  "includeModules": {
    "forceExclude": [
      "aws-sdk",
      "core-node-sdk"
    ]
  },
  "webpackConfig": "webpack.config.js",
  "packager": "npm",
  "packagerOptions": {},
  "keepOutputDirectory": false,
  "concurrency": 8
}

Additional Data

  • Serverless-Webpack Version you're using: 5.11.0
  • Webpack version you're using: 5.75.0
  • Serverless Framework Version you're using: 3.25.1
  • Operating System: Fedora Linux 64bit
  • Stack Trace (if available): no stacktrack
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant