Package Exports
- @flowaccount/nx-serverless
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@flowaccount/nx-serverless) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@flowaccount/nx-serverless
Angular CLI Builders for Serverless Framework projects, designed for use alongside nx
Why
nx superpowers the angular CLI, to add support for a range of backend project types.
However, what if your backend uses Serverless?
This project includes toolsets for generating building, testing and deploying for that.
ng build api- builds your functions and layersng serve api- runs your serverless application offline for debugging and developmentng deploy api- deploys your serverless api
ng g @flowaccount/nx-serverless:apiThis will Add the following to your angular.json
{
"api": "root": "api",
"sourceRoot": "api/src",
"projectType": "application",
"prefix": "frontend-flowaccount-landing-ssr",
"schematics": {},
"architect": {
"build": {
"builder": "@flowaccount/nx-serverless:build",
"options": {
"outputPath": "dist/ap",
"serverlessConfig": "api/serverless.yml",
"servicePath": "api",
"tsConfig": "api/tsconfig.app.json",
"provider": "aws",
"watch": true,
"progress": true
},
"configurations": {
"dev": {
"optimization": false,
"sourceMap": false,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
}
]
},
"production": {
"optimization": true,
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
}
],
"fileReplacements": [
{
"replace": "api/environment.ts",
"with": "api/environment.prod.ts"
}
]
}
}
},
"serve": {
"builder": "@flowaccount/nx-serverless:offline",
"options": {
"waitUntilTargets": [ "frontend-flowaccount-landing:build", "frontend-flowaccount-landing:server"],
"buildTarget": "frontend-flowaccount-landing-ssr:build",
"config": "api/serverless.yml",
"location": "dist/ap"
},
"configurations": {
"dev": {
"buildTarget": "frontend-flowaccount-landing-ssr:build:dev"
},
"production": {
"buildTarget": "frontend-flowaccount-landing-ssr:build:production"
}
}
},
"deploy": {
"builder": "@flowaccount/nx-serverless:deploy",
"options": {
"buildTarget": "frontend-flowaccount-landing-ssr:build:production",
"config": "api/serverless.yml",
"location": "dist/ap",
"package": "dist/ap"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"api/tsconfig.app.json",
"api/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**",
"!api/**"
]
}
},
"test": {
"builder": "@nrwl/jest:jest",
"options": {
"jestConfig": "api/jest.config.js",
"tsConfig": "api/tsconfig.spec.json"
}
}
}
}
}