Closed lwoodson closed 5 years ago
Gemfile contains some development gems:
# frozen_string_literal: true source "https://rubygems.org" git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } group :development do gem "rake" gem "rspec" gem "pry-byebug" gem "rubocop" end
Relevant serverless.yml:
serverless.yml
plugins: - serverless-localstack provider: name: aws runtime: ruby2.5 stage: ${opt:stage} region: ${opt:region} profile: ${opt:profile} package: excludeDevDependencies: false # only applies to node include: - handlers.rb - lib/**
Running sls package and checking the size of the .serverless/<service>.zip file:
sls package
.serverless/<service>.zip
-rw-r--r-- 1 lwoodson staff 5.3M Mar 27 14:44 shipit-qbridge.zip
When I add the redis gem to the Gemfile:
# frozen_string_literal: true source "https://rubygems.org" git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } gem "redis", "~> 3.3.3" group :development do gem "rake" gem "rspec" gem "pry-byebug" gem "rubocop" end
Packaging is optimized as expected. Here is the size of the .serverless/<service>.zip file after running sls package again:
-rw-r--r-- 1 lwoodson staff 67K Mar 27 14:46 shipit-qbridge.zip
This has been resolved by https://github.com/joshuaflanagan/serverless-ruby-package/commit/a4452200848bebeba59c9aed9e6c1c65a6f2c590 and is available in the 1.1.0 release.
Gemfile contains some development gems:
Relevant
serverless.yml
:Running
sls package
and checking the size of the.serverless/<service>.zip
file:When I add the redis gem to the Gemfile:
Packaging is optimized as expected. Here is the size of the
.serverless/<service>.zip
file after runningsls package
again: