serverless-js-transpiler

raw JSON →
0.1.1 verified Fri May 01 auth: no javascript

A Serverless Framework plugin for transpiling JavaScript to ES2015/16/17 using Babel. Version 0.1.1 is a work-in-progress with no recent releases. It integrates with the serverless lifecycle to transpile files before packaging or deployment. Compared to alternatives like serverless-webpack or serverless-bundle, this plugin is minimal but lacks maintenance and documentation.

error Cannot find module 'serverless-js-transpiler'
cause Plugin not installed or not specified correctly in serverless.yml
fix
Run npm install serverless-js-transpiler --save-dev and add 'serverless-js-transpiler' to plugins list in serverless.yml.
error Error: ENOENT: no such file or directory, open 'build/...'
cause Handler path points to build/ but code not transpiled yet
fix
Run serverless package or serverless deploy first to generate build/.
deprecated Package is WIP and no updates since initial release
fix Use actively maintained alternatives like serverless-webpack or serverless-bundle.
gotcha Handler paths must point to build/ directory after transpilation
fix Set handler to e.g. build/index.handler instead of src/index.handler.
npm install serverless-js-transpiler
yarn add serverless-js-transpiler
pnpm add serverless-js-transpiler

Configures the plugin in serverless.yml to transpile JavaScript and output to build/ directory.

# serverless.yml
plugins:
  - serverless-js-transpiler

provider:
  name: aws
  runtime: nodejs12.x

functions:
  hello:
    handler: build/handler.hello
    events:
      - http:
          path: hello
          method: get