Skip to content

Commit

Permalink
chore: 🤖 setup for typescript, serverless-offline, debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
vaibhavarora14 committed Jan 9, 2022
1 parent f70de6a commit 4120a5f
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 3 deletions.
18 changes: 18 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "pwa-node",
"request": "launch",
"name": "Launch Program",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}/dist/app.js",
"port": "9229"
}
]
}
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
"name": "responder",
"version": "1.0.0",
"description": "",
"main": "app.js",
"main": "dist/app.js",
"scripts": {
"start": "serverless offline --noPrependStageInUrl",
"cleanup": "rm -rf dist",
"build": "yarn cleanup && tsc -p .",
"build:watch": "yarn cleanup && tsc -w -p .",
"start": "yarn build && serverless offline --location dist --noPrependStageInUrl",
"start:debug": "yarn build && node --inspect ./node_modules/.bin/serverless offline --location dist --noPrependStageInUrl",
"deploy": "serverless deploy"
},
"author": "",
Expand All @@ -16,6 +20,7 @@
},
"devDependencies": {
"nodemon": "^2.0.15",
"serverless-offline": "^8.3.1"
"serverless-offline": "^8.3.1",
"typescript": "^4.5.4"
}
}
3 changes: 3 additions & 0 deletions serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ functions:
method: post
plugins:
- serverless-offline
custom:
serverless-offline:
port: 4000
useDotEnv: true
18 changes: 18 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"moduleResolution": "node",
"esModuleInterop": true,
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"allowJs": true,
"sourceMap": true,
"rootDir": "src",
"outDir": "dist"
},
"include": [
"src/**/*"
]
}

0 comments on commit 4120a5f

Please sign in to comment.