Graphcool / graphcool-framework

Apache License 2.0
1.77k stars 131 forks source link

adding devDependencies exceeds maximum possible bundle size #554

Open usulpro opened 5 years ago

usulpro commented 5 years ago

For bug reports, please fill in the next sections:

Current behavior

Looks like devDependencies are being included to the bundle during gcf deploy

Reproduction

mkdir test-bundle-size
cd test-bundle-size
yarn init -y
yarn add --dev graphcool
yarn gcf init .
yarn add --dev graphcool # since gcf init overrides dependencies
yarn gcf deploy

it will be deployed fine with the selected settings and it takes only 9 sec for bundling functions:

Creating service test-bundle-size in cluster shared-eu-west-1... ✔
Bundling functions... 9.0s
Deploying... 2.2s

Success! Created the following service:

Then just add a bit devDependencies:

yarn add --dev eslint eslint-plugin-json
yarn gcf deploy

As a result, it'll throw:

Bundling functions... 25.6s
Deploying to shared-eu-west-1 with target prod... 1.5s
There are issues with the new service definition:

  Global
    ✖ software.amazon.awssdk.services.lambda.model.InvalidParameterValueException: Unzipped size must be smaller than 262144000 bytes (Service: null; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: 38e0862c-9ef3-11e8-9df8-672a0ee9b568)

Expected behavior?

devDependencies don't affect to bundling time and bundle size