Enigmatic-Smile / serverless-plugin-optimize

⛔️ DEPRECATED ⛔️ Bundle with Browserify, transpile and minify with Babel automatically to your NodeJS runtime compatible JavaScript

Home Page:https://www.npmjs.com/package/serverless-plugin-optimize

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Code not optimized when runtime set to 10.x

moamenet opened this issue · comments

Whenever I set the runtime to nodejs10.x, the uploaded project is not optimized. When I set it to nodejs.8.10, everything works as expected.
my serverless.yml:

service: ${file(serverless-vars.json):service}-main

provider:
  name: aws
  stage: [some stage]
  region: [some region]
  profile: [some profile]
  runtime: nodejs8.10
  role: [some role]

package:
  individually: true
  excludeDevDependencies: false
  exclude:
    - ./**

plugins:
  - serverless-plugin-optimize

functions:
  - main:
      handler: functions/main/index.handler
      package:
        include:
          - functions/main/**
      events:
        - http:
            path: /
            method: get
            cors: true

after deployment with 10.x, the folder structutre on the lambda is
main-dev-main->functions->main and inside index.js, node_modules folder etc

when deployed with 8.10:
main-dev-main->_optimize->main-dev-main->functions->main with only index.js inside (as expected)

Any idea, why I have this different behaviors ?
used version of the plugin: 4.0.2-rc.1

ok, issue was on my side (and even visible above): wasn't using the latest version.
Updated and now everything works just fine