The weirdest thing is happening. I’m using typescript and not all my typescript files within a single directory are getting compiled, i.e. there’s one director in my source tree where a few of the .ts files are being compiled to .js and the others aren’t.
When I run a simple tsc, all files are compiled, but when I run ‘serverless offline start’, not all files are compiled.
Anybody know how to fix?
Basics of my serverless.yml:
package:
include:
- src/**/*
functions:
graphql:
handler: src/graphql.handler
events:
- http:
path: graphql
method: post
cors: true
plugins:
- serverless-plugin-typescript
- serverless-offline
tsconfig.json:
{
"compilerOptions": {
/* Basic Options */
"target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
"lib": [
"es6",
"dom",
"esnext.asynciterable"
], /* Specify library files to be included in the compilation. */
"allowJs": true, /* Allow javascript files to be compiled. */
"sourceMap": true, /* Generates corresponding '.map' file. */
"outDir": ".build/src", /* Redirect output structure to the directory. */
"rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
"removeComments": true, /* Do not emit comments to output. */
"strict": true, /* Enable all strict type-checking options. */
"noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
"strictNullChecks": true, /* Enable strict null checks. */
"strictPropertyInitialization": false, /* Enable strict checking of property initialization in classes. */
"noUnusedLocals": true, /* Report errors on unused locals. */
"noUnusedParameters": false, /* Report errors on unused parameters. */
"moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
"experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
"emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
},
"include": [
"src/**/*"
],
"types": [
"typePatches",
"nodes"
]
}