@@ -5,70 +5,9 @@ import * as path from 'path';
5
5
import { mergeRight , union , without } from 'ramda' ;
6
6
7
7
import { packExternalModules } from './pack-externals' ;
8
+ import { NodejsFunctionProps } from './props' ;
8
9
import { extractFileName , findProjectRoot , nodeMajorVersion } from './utils' ;
9
10
10
- /**
11
- * Properties for a NodejsFunction
12
- */
13
- export interface NodejsFunctionProps extends lambda . FunctionOptions {
14
- /**
15
- * The root of the lambda project. If you specify this prop, ensure that
16
- * this path includes `entry` and any module/dependencies used by your
17
- * function otherwise bundling will not be possible.
18
- *
19
- * @default = the closest path containing a .git folder
20
- */
21
- readonly rootDir ?: string ;
22
-
23
- /**
24
- * The name of the method within your code that Lambda calls to execute your function.
25
- *
26
- * The format includes the file name and handler function.
27
- * For more information, see https://docs.aws.amazon.com/lambda/latest/dg/lambda-nodejs.html.
28
- *
29
- * @default = 'index.handler'
30
- */
31
- readonly handler ?: string ;
32
-
33
- /**
34
- * The runtime environment. Only runtimes of the Node.js family are
35
- * supported.
36
- *
37
- * @default = `NODEJS_12_X` if `process.versions.node` >= '12.0.0',
38
- * `NODEJS_10_X` otherwise.
39
- */
40
- readonly runtime ?: lambda . Runtime ;
41
-
42
- /**
43
- * The list of modules that must be excluded from bundle and from externals.
44
- *
45
- * @default = ['aws-sdk']
46
- */
47
- readonly exclude ?: string [ ] ;
48
-
49
- /**
50
- * Whether to use package manager to pack external modules or explicit name of a well known packager.
51
- *
52
- * @default = true // Determined based on what preference is set, and whether it's currently running in a yarn/npm script
53
- */
54
- readonly packager ?: Packager | boolean ;
55
-
56
- /**
57
- * The esbuild bundler specific options.
58
- *
59
- * @default = { bundle: true, target: 'es2017' }
60
- */
61
- readonly esbuildOptions ?: es . BuildOptions ;
62
- }
63
-
64
- /**
65
- * Package manager to pack external modules.
66
- */
67
- export enum Packager {
68
- NPM = 'npm' ,
69
- YARN = 'yarn' ,
70
- }
71
-
72
11
const BUILD_FOLDER = '.build' ;
73
12
const DEFAULT_BUILD_OPTIONS : es . BuildOptions = {
74
13
bundle : true ,
0 commit comments