Skip to content
This repository has been archived by the owner on Oct 14, 2021. It is now read-only.

Function-level module excludes not working #46

Open
ckfngod opened this issue Jun 19, 2018 · 1 comment
Open

Function-level module excludes not working #46

ckfngod opened this issue Jun 19, 2018 · 1 comment

Comments

@ckfngod
Copy link

ckfngod commented Jun 19, 2018

functions:
  my-function:
    modules:
      exclude:
        - winston

This is not excluding winston from the my-function package. Am I missing something here?

@nfour
Copy link
Owner

nfour commented Jun 20, 2018

You may need to use excludeDeep as something else may be including it.

# functions
#
# Like the serverless.yml functions definition, but only for build options
functions:
  myFunction:
    # include
    #
    # An array of glob patterns to match against, including each file
    include:
      - functions/one/**
      - lib/one/**

    # exclude
    #
    # An array of glob patterns to exclude from the `include`
    exclude:
      - **/*.json

    modules:
      # modules.exclude
      #
      # Exclude specific node_modules for a function
      exclude:
        - lutils

      # modules.excludeDeep
      #
      # Exclude deeply nested node_modules for a function
      excludeDeep:
        - lutils

Also make sure this is defined inside of the build config object/file and not the serverless.yml:functions,

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants