Build and Deploy Serverless Application with webpack

npm i -g serverless
npm install -D webpack typescript ts-loader serverless-webpack webpack-node-externals terser-webpack-plugin fork-ts-checker-webpack-plugin
 npm install aws-sdk lodash @types/lodash 
touch serverless.yml
touch webpack.config.js
touch tsconfig.json

helloLambda.ts
testLambda.ts
tsconfig.json
webpack.config.js
serverless.yml
package:  
individually: true
plugins:  
- serverless-webpack
custom:  
webpack:
webpackConfig: './webpack.config.js'
packager: 'npm'
includeModules:
forceExclude:
- aws-sdk
serverless config credentials --provider aws --key <Access Key ID> --secret <Secret Access Key>
sls deploy --config serverless.yml
serverless deployment result
sls invoke -f  testLambda  -l
lambda invoke result
sls remove 
remove serverless stack

Full Stack Engineer | Building Beautiful UI | Problem Solver

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Big O Notation — Time and Space Complexity

How To Calculate Javascript Difference Between Two Dates In Days

Alpaca OAuth Integration with React and Firebase Pt. 1

Either this or that

Set Up Salesforce Developer Experience (DX) environment

Using Vue.js + Vue Apollo + GraphQL to Build a Bulk Link Opening App — Part 2

State in React

**【数码宝贝:最后的进化 】完整版本[2020~HD]-《Digimon Adventure: Last Evolution Kizuna 》電影在線完整版-HD-BLURAY.!!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Anis Alam

Anis Alam

Full Stack Engineer | Building Beautiful UI | Problem Solver

More from Medium

AWS DynamoDB ORM (Dynamoose) with Node.js #1

aws dynamodb

Deploy Fastify app to AWS Lambda

AWS Lambda TypeScript Unit Test using Jest (DynamoDB) — part3

How to build and package Node.js Lambda code along with dependencies in Docker