Skip to content

How to avoid duplicate optimizer config for each function? #30

@martinmicunda

Description

@martinmicunda

The serverless v0.0.5 has removed the concept of components so I tried to move the optimizer config from s-component.json to s-project.json however this doesn't work and as it mentions in the doc optimizer config needs to be add to each s-function.json so my question is, is there a way how we could avoid duplicate this config for each function either by placing this config to s-project.json or add it to s-templates.json (template options doesn't work as it doesn't seem to compile optimize template).

s-templates.json

    "optimize": {
      "exclude": [
        "aws-sdk"
      ],
      "transforms": [
        {
          "name": "babelify",
          "opts": {
            "presets": [
              "es2015",
              "stage-2"
            ]
          }
        }
      ],
      "minify": false
    }

s-function.json

  "custom": {
    "excludePatterns": [ "aws-sdk"],
    "optimize": "$${optimize}"
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions