mirror of
https://github.com/encounter/serverless-plugin-typescript.git
synced 2026-03-30 11:37:55 -07:00
e37c45f6c918af949a63e39bd8ea4f2c8cd41db7
Serverless 0.16.0 introduced a feature which excludes Node.js dev dependencies from .zip files. The feature uses package.json to find which dependencies can be excluded. https://github.com/serverless/serverless/pull/3737 This commit adds the package.json to the .build folder, so that Serverless can find the package.json file.
serverless-plugin-typescript
Serverless plugin for zero-config Typescript support
Features
- Zero-config: Works out of the box without the need to install any other compiler or plugins
- Supports ES2015 syntax + features (
export,import,async,await,Promise, ...)
Install
yarn add --dev serverless-plugin-typescript
Add the following plugin to your serverless.yml:
plugins:
- serverless-plugin-typescript
Example
See example folder for a minimal example.
tsconfig.json
The default tsconfig.json file used by the plugin looks like this:
{
"preserveConstEnums": true,
"strictNullChecks": true,
"sourceMap": true,
"target": "es5",
"outDir": ".build",
"moduleResolution": "node",
"lib": ["es2015"],
"rootDir": "./"
}
Note 1: The
outDiroption cannot be overwritten.
Note 2: Don't confuse the
tsconfig.jsonin this repository with the one mentioned above.
Including extra files
All files from package/include will be included in the final build file. See Exclude/Include
Help & Community 
Join our Slack community if you run into issues or have questions. We love talking to you!
Description
Languages
TypeScript
100%
