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

Excluding aws-sdk with webpack is not intuitive #37

Open
sevenseat opened this issue Jun 24, 2017 · 1 comment
Open

Excluding aws-sdk with webpack is not intuitive #37

sevenseat opened this issue Jun 24, 2017 · 1 comment

Comments

@sevenseat
Copy link

sevenseat commented Jun 24, 2017

I'm not sure this is a bug, but I found excluding the aws-sdk in a file build method using webpack unintuitive. Not only does it need to be excluded within the webpack.config.js using:
externals: ['aws-sdk']

But it also needs to excluded in the serverless.build.yml using

modules:
  exclude:
     - aws-sdk
  deepExclude: # Excluded from deep nested node_modules
    - aws-sdk

It seems odd to have to exclude it in both places.

@nfour
Copy link
Owner

nfour commented Jun 25, 2017

The reason for this is that webpack is its own thing, and it's expected that to use it you understand the way webpack works. Externals are basically saying to webpack "dont try to bundle this". The module excludes from this plugin can then take effect.

It may be that it should be documented as a use-case, though.

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