Documentation ¶
Overview ¶
CDK constructs for esbuild, an extremely fast JavaScript bundler
Index ¶
- func EsbuildProvider_OverrideDefaultBuildProvider(provider IBuildProvider)
- func EsbuildProvider_OverrideDefaultProvider(provider IEsbuildProvider)
- func EsbuildProvider_OverrideDefaultTransformationProvider(provider ITransformProvider)
- func EsbuildSource_Anywhere() *string
- func EsbuildSource_Auto() *string
- func EsbuildSource_GlobalPaths() *string
- func EsbuildSource_Install() *string
- func EsbuildSource_NodeJs() *string
- func EsbuildSource_PlatformDefault() *string
- func InlineJavaScriptCode_FromAsset(path *string, options *awss3assets.AssetOptions) awslambda.AssetCode
- func InlineJavaScriptCode_FromAssetImage(directory *string, props *awslambda.AssetImageCodeProps) awslambda.AssetImageCode
- func InlineJavaScriptCode_FromBucket(bucket awss3.IBucket, key *string, objectVersion *string) awslambda.S3Code
- func InlineJavaScriptCode_FromCfnParameters(props *awslambda.CfnParametersCodeProps) awslambda.CfnParametersCode
- func InlineJavaScriptCode_FromDockerBuild(path *string, options *awslambda.DockerBuildAssetOptions) awslambda.AssetCode
- func InlineJavaScriptCode_FromEcrImage(repository awsecr.IRepository, props *awslambda.EcrImageCodeProps) awslambda.EcrImageCode
- func InlineJavaScriptCode_FromInline(code *string) awslambda.InlineCode
- func InlineTypeScriptCode_FromAsset(path *string, options *awss3assets.AssetOptions) awslambda.AssetCode
- func InlineTypeScriptCode_FromAssetImage(directory *string, props *awslambda.AssetImageCodeProps) awslambda.AssetImageCode
- func InlineTypeScriptCode_FromBucket(bucket awss3.IBucket, key *string, objectVersion *string) awslambda.S3Code
- func InlineTypeScriptCode_FromCfnParameters(props *awslambda.CfnParametersCodeProps) awslambda.CfnParametersCode
- func InlineTypeScriptCode_FromDockerBuild(path *string, options *awslambda.DockerBuildAssetOptions) awslambda.AssetCode
- func InlineTypeScriptCode_FromEcrImage(repository awsecr.IRepository, props *awslambda.EcrImageCodeProps) awslambda.EcrImageCode
- func InlineTypeScriptCode_FromInline(code *string) awslambda.InlineCode
- func NewEsbuildBundler_Override(e EsbuildBundler, entryPoints interface{}, props *BundlerProps)
- func NewEsbuildProvider_Override(e EsbuildProvider, props *EsbuildProviderProps)
- func NewInlineJavaScriptCode_Override(i InlineJavaScriptCode, code *string, props *TransformerProps)
- func NewInlineTypeScriptCode_Override(i InlineTypeScriptCode, code *string, props *TransformerProps)
- func NewTypeScriptAsset_Override(t TypeScriptAsset, scope constructs.Construct, id *string, ...)
- func NewTypeScriptCode_Override(t TypeScriptCode, entryPoints interface{}, props *TypeScriptCodeProps)
- func NewTypeScriptSource_Override(t TypeScriptSource, entryPoints interface{}, props *TypeScriptSourceProps)
- func TypeScriptAsset_IsConstruct(x interface{}) *bool
- func TypeScriptCode_FromAsset(path *string, options *awss3assets.AssetOptions) awslambda.AssetCode
- func TypeScriptCode_FromAssetImage(directory *string, props *awslambda.AssetImageCodeProps) awslambda.AssetImageCode
- func TypeScriptCode_FromBucket(bucket awss3.IBucket, key *string, objectVersion *string) awslambda.S3Code
- func TypeScriptCode_FromCfnParameters(props *awslambda.CfnParametersCodeProps) awslambda.CfnParametersCode
- func TypeScriptCode_FromDockerBuild(path *string, options *awslambda.DockerBuildAssetOptions) awslambda.AssetCode
- func TypeScriptCode_FromEcrImage(repository awsecr.IRepository, props *awslambda.EcrImageCodeProps) awslambda.EcrImageCode
- func TypeScriptCode_FromInline(code *string) awslambda.InlineCode
- type BuildOptions
- type BundlerProps
- type CodeConfig
- type CompilerOptions
- type EsbuildBundler
- type EsbuildProvider
- type EsbuildProviderProps
- type EsbuildSource
- type IBuildProvider
- type IEsbuildProvider
- type ITransformProvider
- type InlineJavaScriptCode
- type InlineTypeScriptCode
- type ProviderBuildOptions
- type ProviderTransformOptions
- type TransformOptions
- type TransformerProps
- type TsconfigRaw
- type TypeScriptAsset
- type TypeScriptAssetProps
- type TypeScriptCode
- type TypeScriptCodeProps
- type TypeScriptSource
- type TypeScriptSourceProps
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EsbuildProvider_OverrideDefaultBuildProvider ¶
func EsbuildProvider_OverrideDefaultBuildProvider(provider IBuildProvider)
Set the default implementation for the Build API.
func EsbuildProvider_OverrideDefaultProvider ¶
func EsbuildProvider_OverrideDefaultProvider(provider IEsbuildProvider)
Set the default implementation for both Build and Transformation API.
func EsbuildProvider_OverrideDefaultTransformationProvider ¶
func EsbuildProvider_OverrideDefaultTransformationProvider(provider ITransformProvider)
Set the default implementation for the Transformation API.
func EsbuildSource_Anywhere ¶
func EsbuildSource_Anywhere() *string
Try to find the module in most common paths.
func EsbuildSource_Auto ¶
func EsbuildSource_Auto() *string
First try to find to module, then install it to a temporary location.
func EsbuildSource_GlobalPaths ¶
func EsbuildSource_GlobalPaths() *string
Try to find the module in common global installation paths.
func EsbuildSource_Install ¶
func EsbuildSource_Install() *string
Install the module to a temporary location.
func EsbuildSource_NodeJs ¶
func EsbuildSource_NodeJs() *string
Require module by name, do not attempt to find it anywhere else.
func EsbuildSource_PlatformDefault ¶
func EsbuildSource_PlatformDefault() *string
`EsbuildSource.nodeJs()` for NodeJs, `EsbuildSource.auto()` for all other languages.
func InlineJavaScriptCode_FromAsset ¶
func InlineJavaScriptCode_FromAsset(path *string, options *awss3assets.AssetOptions) awslambda.AssetCode
Loads the function code from a local disk path.
func InlineJavaScriptCode_FromAssetImage ¶
func InlineJavaScriptCode_FromAssetImage(directory *string, props *awslambda.AssetImageCodeProps) awslambda.AssetImageCode
Create an ECR image from the specified asset and bind it as the Lambda code.
func InlineJavaScriptCode_FromBucket ¶
func InlineJavaScriptCode_FromBucket(bucket awss3.IBucket, key *string, objectVersion *string) awslambda.S3Code
Lambda handler code as an S3 object.
func InlineJavaScriptCode_FromCfnParameters ¶
func InlineJavaScriptCode_FromCfnParameters(props *awslambda.CfnParametersCodeProps) awslambda.CfnParametersCode
Creates a new Lambda source defined using CloudFormation parameters.
Returns: a new instance of `CfnParametersCode`.
func InlineJavaScriptCode_FromDockerBuild ¶
func InlineJavaScriptCode_FromDockerBuild(path *string, options *awslambda.DockerBuildAssetOptions) awslambda.AssetCode
Loads the function code from an asset created by a Docker build.
By default, the asset is expected to be located at `/asset` in the image.
func InlineJavaScriptCode_FromEcrImage ¶
func InlineJavaScriptCode_FromEcrImage(repository awsecr.IRepository, props *awslambda.EcrImageCodeProps) awslambda.EcrImageCode
Use an existing ECR image as the Lambda code.
func InlineJavaScriptCode_FromInline ¶
func InlineJavaScriptCode_FromInline(code *string) awslambda.InlineCode
Inline code for Lambda handler.
Returns: `LambdaInlineCode` with inline code.
func InlineTypeScriptCode_FromAsset ¶
func InlineTypeScriptCode_FromAsset(path *string, options *awss3assets.AssetOptions) awslambda.AssetCode
Loads the function code from a local disk path.
func InlineTypeScriptCode_FromAssetImage ¶
func InlineTypeScriptCode_FromAssetImage(directory *string, props *awslambda.AssetImageCodeProps) awslambda.AssetImageCode
Create an ECR image from the specified asset and bind it as the Lambda code.
func InlineTypeScriptCode_FromBucket ¶
func InlineTypeScriptCode_FromBucket(bucket awss3.IBucket, key *string, objectVersion *string) awslambda.S3Code
Lambda handler code as an S3 object.
func InlineTypeScriptCode_FromCfnParameters ¶
func InlineTypeScriptCode_FromCfnParameters(props *awslambda.CfnParametersCodeProps) awslambda.CfnParametersCode
Creates a new Lambda source defined using CloudFormation parameters.
Returns: a new instance of `CfnParametersCode`.
func InlineTypeScriptCode_FromDockerBuild ¶
func InlineTypeScriptCode_FromDockerBuild(path *string, options *awslambda.DockerBuildAssetOptions) awslambda.AssetCode
Loads the function code from an asset created by a Docker build.
By default, the asset is expected to be located at `/asset` in the image.
func InlineTypeScriptCode_FromEcrImage ¶
func InlineTypeScriptCode_FromEcrImage(repository awsecr.IRepository, props *awslambda.EcrImageCodeProps) awslambda.EcrImageCode
Use an existing ECR image as the Lambda code.
func InlineTypeScriptCode_FromInline ¶
func InlineTypeScriptCode_FromInline(code *string) awslambda.InlineCode
Inline code for Lambda handler.
Returns: `LambdaInlineCode` with inline code.
func NewEsbuildBundler_Override ¶
func NewEsbuildBundler_Override(e EsbuildBundler, entryPoints interface{}, props *BundlerProps)
Experimental.
func NewEsbuildProvider_Override ¶
func NewEsbuildProvider_Override(e EsbuildProvider, props *EsbuildProviderProps)
func NewInlineJavaScriptCode_Override ¶
func NewInlineJavaScriptCode_Override(i InlineJavaScriptCode, code *string, props *TransformerProps)
func NewInlineTypeScriptCode_Override ¶
func NewInlineTypeScriptCode_Override(i InlineTypeScriptCode, code *string, props *TransformerProps)
func NewTypeScriptAsset_Override ¶
func NewTypeScriptAsset_Override(t TypeScriptAsset, scope constructs.Construct, id *string, props *TypeScriptAssetProps)
func NewTypeScriptCode_Override ¶
func NewTypeScriptCode_Override(t TypeScriptCode, entryPoints interface{}, props *TypeScriptCodeProps)
func NewTypeScriptSource_Override ¶
func NewTypeScriptSource_Override(t TypeScriptSource, entryPoints interface{}, props *TypeScriptSourceProps)
func TypeScriptAsset_IsConstruct ¶
func TypeScriptAsset_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead.
func TypeScriptCode_FromAsset ¶
func TypeScriptCode_FromAsset(path *string, options *awss3assets.AssetOptions) awslambda.AssetCode
Loads the function code from a local disk path.
func TypeScriptCode_FromAssetImage ¶
func TypeScriptCode_FromAssetImage(directory *string, props *awslambda.AssetImageCodeProps) awslambda.AssetImageCode
Create an ECR image from the specified asset and bind it as the Lambda code.
func TypeScriptCode_FromBucket ¶
func TypeScriptCode_FromBucket(bucket awss3.IBucket, key *string, objectVersion *string) awslambda.S3Code
Lambda handler code as an S3 object.
func TypeScriptCode_FromCfnParameters ¶
func TypeScriptCode_FromCfnParameters(props *awslambda.CfnParametersCodeProps) awslambda.CfnParametersCode
Creates a new Lambda source defined using CloudFormation parameters.
Returns: a new instance of `CfnParametersCode`.
func TypeScriptCode_FromDockerBuild ¶
func TypeScriptCode_FromDockerBuild(path *string, options *awslambda.DockerBuildAssetOptions) awslambda.AssetCode
Loads the function code from an asset created by a Docker build.
By default, the asset is expected to be located at `/asset` in the image.
func TypeScriptCode_FromEcrImage ¶
func TypeScriptCode_FromEcrImage(repository awsecr.IRepository, props *awslambda.EcrImageCodeProps) awslambda.EcrImageCode
Use an existing ECR image as the Lambda code.
func TypeScriptCode_FromInline ¶
func TypeScriptCode_FromInline(code *string) awslambda.InlineCode
Inline code for Lambda handler.
Returns: `LambdaInlineCode` with inline code.
Types ¶
type BuildOptions ¶
type BuildOptions struct { // Documentation: https://esbuild.github.io/api/#working-directory. AbsWorkingDir *string `field:"optional" json:"absWorkingDir" yaml:"absWorkingDir"` // Documentation: https://esbuild.github.io/api/#alias. Alias *map[string]*string `field:"optional" json:"alias" yaml:"alias"` // Documentation: https://esbuild.github.io/api/#allow-overwrite. AllowOverwrite *bool `field:"optional" json:"allowOverwrite" yaml:"allowOverwrite"` // Documentation: https://esbuild.github.io/api/#asset-names. AssetNames *string `field:"optional" json:"assetNames" yaml:"assetNames"` // Documentation: https://esbuild.github.io/api/#banner. Banner *map[string]*string `field:"optional" json:"banner" yaml:"banner"` // Documentation: https://esbuild.github.io/api/#bundle. Bundle *bool `field:"optional" json:"bundle" yaml:"bundle"` // Documentation: https://esbuild.github.io/api/#charset. Charset *string `field:"optional" json:"charset" yaml:"charset"` // Documentation: https://esbuild.github.io/api/#chunk-names. ChunkNames *string `field:"optional" json:"chunkNames" yaml:"chunkNames"` // Documentation: https://esbuild.github.io/api/#color. Color *bool `field:"optional" json:"color" yaml:"color"` // Documentation: https://esbuild.github.io/api/#conditions. Conditions *[]*string `field:"optional" json:"conditions" yaml:"conditions"` // Documentation: https://esbuild.github.io/api/#define. Define *map[string]*string `field:"optional" json:"define" yaml:"define"` // Documentation: https://esbuild.github.io/api/#drop. Drop *[]*string `field:"optional" json:"drop" yaml:"drop"` // Documentation: https://esbuild.github.io/api/#drop-labels. DropLabels *[]*string `field:"optional" json:"dropLabels" yaml:"dropLabels"` // Documentation: https://esbuild.github.io/api/#entry-names. EntryNames *string `field:"optional" json:"entryNames" yaml:"entryNames"` // Documentation: https://esbuild.github.io/api/#external. External *[]*string `field:"optional" json:"external" yaml:"external"` Footer *map[string]*string `field:"optional" json:"footer" yaml:"footer"` // Documentation: https://esbuild.github.io/api/#format. Format *string `field:"optional" json:"format" yaml:"format"` // Documentation: https://esbuild.github.io/api/#global-name. GlobalName *string `field:"optional" json:"globalName" yaml:"globalName"` // Documentation: https://esbuild.github.io/api/#ignore-annotations. IgnoreAnnotations *bool `field:"optional" json:"ignoreAnnotations" yaml:"ignoreAnnotations"` // Documentation: https://esbuild.github.io/api/#inject. Inject *[]*string `field:"optional" json:"inject" yaml:"inject"` // Documentation: https://esbuild.github.io/api/#jsx. Jsx *string `field:"optional" json:"jsx" yaml:"jsx"` // Documentation: https://esbuild.github.io/api/#jsx-development. JsxDev *bool `field:"optional" json:"jsxDev" yaml:"jsxDev"` // Documentation: https://esbuild.github.io/api/#jsx-factory. JsxFactory *string `field:"optional" json:"jsxFactory" yaml:"jsxFactory"` // Documentation: https://esbuild.github.io/api/#jsx-fragment. JsxFragment *string `field:"optional" json:"jsxFragment" yaml:"jsxFragment"` // Documentation: https://esbuild.github.io/api/#jsx-import-source. JsxImportSource *string `field:"optional" json:"jsxImportSource" yaml:"jsxImportSource"` // Documentation: https://esbuild.github.io/api/#jsx-side-effects. JsxSideEffects *bool `field:"optional" json:"jsxSideEffects" yaml:"jsxSideEffects"` // Documentation: https://esbuild.github.io/api/#keep-names. KeepNames *bool `field:"optional" json:"keepNames" yaml:"keepNames"` // Documentation: https://esbuild.github.io/api/#legal-comments. LegalComments *string `field:"optional" json:"legalComments" yaml:"legalComments"` // Documentation: https://esbuild.github.io/api/#line-limit. LineLimit *float64 `field:"optional" json:"lineLimit" yaml:"lineLimit"` // Documentation: https://esbuild.github.io/api/#loader. Loader *map[string]*string `field:"optional" json:"loader" yaml:"loader"` // Documentation: https://esbuild.github.io/api/#log-level. LogLevel *string `field:"optional" json:"logLevel" yaml:"logLevel"` // Documentation: https://esbuild.github.io/api/#log-limit. LogLimit *float64 `field:"optional" json:"logLimit" yaml:"logLimit"` // Documentation: https://esbuild.github.io/api/#log-override. LogOverride *map[string]*string `field:"optional" json:"logOverride" yaml:"logOverride"` // Documentation: https://esbuild.github.io/api/#main-fields. MainFields *[]*string `field:"optional" json:"mainFields" yaml:"mainFields"` // Documentation: https://esbuild.github.io/api/#mangle-props. MangleCache *map[string]interface{} `field:"optional" json:"mangleCache" yaml:"mangleCache"` // Documentation: https://esbuild.github.io/api/#mangle-props. MangleProps interface{} `field:"optional" json:"mangleProps" yaml:"mangleProps"` // Documentation: https://esbuild.github.io/api/#mangle-props. MangleQuoted *bool `field:"optional" json:"mangleQuoted" yaml:"mangleQuoted"` // Documentation: https://esbuild.github.io/api/#metafile. Metafile *bool `field:"optional" json:"metafile" yaml:"metafile"` // Documentation: https://esbuild.github.io/api/#minify. Minify *bool `field:"optional" json:"minify" yaml:"minify"` // Documentation: https://esbuild.github.io/api/#minify. MinifyIdentifiers *bool `field:"optional" json:"minifyIdentifiers" yaml:"minifyIdentifiers"` // Documentation: https://esbuild.github.io/api/#minify. MinifySyntax *bool `field:"optional" json:"minifySyntax" yaml:"minifySyntax"` // Documentation: https://esbuild.github.io/api/#minify. MinifyWhitespace *bool `field:"optional" json:"minifyWhitespace" yaml:"minifyWhitespace"` // Documentation: https://esbuild.github.io/api/#node-paths. NodePaths *[]*string `field:"optional" json:"nodePaths" yaml:"nodePaths"` // Documentation: https://esbuild.github.io/api/#outbase. Outbase *string `field:"optional" json:"outbase" yaml:"outbase"` // Documentation: https://esbuild.github.io/api/#outdir. Outdir *string `field:"optional" json:"outdir" yaml:"outdir"` // Documentation: https://esbuild.github.io/api/#out-extension. OutExtension *map[string]*string `field:"optional" json:"outExtension" yaml:"outExtension"` // Documentation: https://esbuild.github.io/api/#outfile. Outfile *string `field:"optional" json:"outfile" yaml:"outfile"` // Documentation: https://esbuild.github.io/api/#packages. Packages *string `field:"optional" json:"packages" yaml:"packages"` // Documentation: https://esbuild.github.io/api/#platform. Platform *string `field:"optional" json:"platform" yaml:"platform"` // Documentation: https://esbuild.github.io/api/#preserve-symlinks. PreserveSymlinks *bool `field:"optional" json:"preserveSymlinks" yaml:"preserveSymlinks"` // Documentation: https://esbuild.github.io/api/#public-path. PublicPath *string `field:"optional" json:"publicPath" yaml:"publicPath"` // Documentation: https://esbuild.github.io/api/#pure. Pure *[]*string `field:"optional" json:"pure" yaml:"pure"` // Documentation: https://esbuild.github.io/api/#mangle-props. ReserveProps interface{} `field:"optional" json:"reserveProps" yaml:"reserveProps"` // Documentation: https://esbuild.github.io/api/#resolve-extensions. ResolveExtensions *[]*string `field:"optional" json:"resolveExtensions" yaml:"resolveExtensions"` // Documentation: https://esbuild.github.io/api/#sourcemap. Sourcemap interface{} `field:"optional" json:"sourcemap" yaml:"sourcemap"` // Documentation: https://esbuild.github.io/api/#source-root. SourceRoot *string `field:"optional" json:"sourceRoot" yaml:"sourceRoot"` // Documentation: https://esbuild.github.io/api/#sources-content. SourcesContent *bool `field:"optional" json:"sourcesContent" yaml:"sourcesContent"` // Documentation: https://esbuild.github.io/api/#splitting. Splitting *bool `field:"optional" json:"splitting" yaml:"splitting"` // Documentation: https://esbuild.github.io/api/#supported. Supported *map[string]*bool `field:"optional" json:"supported" yaml:"supported"` // Documentation: https://esbuild.github.io/api/#target. Target interface{} `field:"optional" json:"target" yaml:"target"` // Documentation: https://esbuild.github.io/api/#tree-shaking. TreeShaking *bool `field:"optional" json:"treeShaking" yaml:"treeShaking"` // Documentation: https://esbuild.github.io/api/#tsconfig. Tsconfig *string `field:"optional" json:"tsconfig" yaml:"tsconfig"` // Documentation: https://esbuild.github.io/api/#tsconfig-raw. TsconfigRaw interface{} `field:"optional" json:"tsconfigRaw" yaml:"tsconfigRaw"` // Documentation: https://esbuild.github.io/api/#write. Write *bool `field:"optional" json:"write" yaml:"write"` }
type BundlerProps ¶
type BundlerProps struct { // Build options passed on to esbuild. Please refer to the esbuild Build API docs for details. // // * `buildOptions.outdir: string` // The actual path for the output directory is defined by CDK. However setting this option allows to write files into a subdirectory. \ // For example `{ outdir: 'js' }` will create an asset with a single directory called `js`, which contains all built files. This approach can be useful for static website deployments, where JavaScript code should be placed into a subdirectory. \ // *Cannot be used together with `outfile`*. // * `buildOptions.outfile: string` // Relative path to a file inside the CDK asset output directory. // For example `{ outfile: 'js/index.js' }` will create an asset with a single directory called `js`, which contains a single file `index.js`. This can be useful to rename the entry point. \ // *Cannot be used with multiple entryPoints or together with `outdir`.* // * `buildOptions.absWorkingDir: string` // Absolute path to the [esbuild working directory](https://esbuild.github.io/api/#working-directory) and defaults to the [current working directory](https://en.wikipedia.org/wiki/Working_directory). \ // If paths cannot be found, a good starting point is to look at the concatenation of `absWorkingDir + entryPoint`. It must always be a valid absolute path pointing to the entry point. When needed, the probably easiest way to set absWorkingDir is to use a combination of `resolve` and `__dirname` (see "Library authors" section in the documentation). // See: https://esbuild.github.io/api/#build-api // BuildOptions *BuildOptions `field:"optional" json:"buildOptions" yaml:"buildOptions"` // The esbuild Build API implementation to be used. // // Configure the default `EsbuildProvider` for more options or // provide a custom `IBuildProvider` as an escape hatch. // Default: new EsbuildProvider(). // BuildProvider IBuildProvider `field:"optional" json:"buildProvider" yaml:"buildProvider"` // Copy additional files to the code [asset staging directory](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.AssetStaging.html#absolutestagedpath), before the build runs. Files copied like this will be overwritten by esbuild if they share the same name as any of the outputs. // // * When provided with a `string` or `array`, all files are copied to the root of asset staging directory. // * When given a `map`, the key indicates the destination relative to the asset staging directory and the value is a list of all sources to be copied. // // Therefore the following values for `copyDir` are all equivalent: // “` // { copyDir: "path/to/source" } // { copyDir: ["path/to/source"] } // { copyDir: { ".": "path/to/source" } } // { copyDir: { ".": ["path/to/source"] } } // “` // The destination cannot be outside of the asset staging directory. // If you are receiving the error "Cannot copy files to outside of the asset staging directory." // you are likely using `..` or an absolute path as key on the `copyDir` map. // Instead use only relative paths and avoid `..`. CopyDir interface{} `field:"optional" json:"copyDir" yaml:"copyDir"` }
type CodeConfig ¶
type CodeConfig struct { // Docker image configuration (mutually exclusive with `s3Location` and `inlineCode`). // Default: - code is not an ECR container image. // Image *awslambda.CodeImageConfig `field:"optional" json:"image" yaml:"image"` // Inline code (mutually exclusive with `s3Location` and `image`). // Default: - code is not inline code. // InlineCode *string `field:"optional" json:"inlineCode" yaml:"inlineCode"` // The location of the code in S3 (mutually exclusive with `inlineCode` and `image`). // Default: - code is not an s3 location. // S3Location *awss3.Location `field:"optional" json:"s3Location" yaml:"s3Location"` }
Result of binding `Code` into a `Function`.
type CompilerOptions ¶
type CompilerOptions struct { AlwaysStrict *bool `field:"optional" json:"alwaysStrict" yaml:"alwaysStrict"` BaseUrl *string `field:"optional" json:"baseUrl" yaml:"baseUrl"` ExperimentalDecorators *bool `field:"optional" json:"experimentalDecorators" yaml:"experimentalDecorators"` ImportsNotUsedAsValues *string `field:"optional" json:"importsNotUsedAsValues" yaml:"importsNotUsedAsValues"` Jsx *string `field:"optional" json:"jsx" yaml:"jsx"` JsxFactory *string `field:"optional" json:"jsxFactory" yaml:"jsxFactory"` JsxFragmentFactory *string `field:"optional" json:"jsxFragmentFactory" yaml:"jsxFragmentFactory"` JsxImportSource *string `field:"optional" json:"jsxImportSource" yaml:"jsxImportSource"` Paths *map[string]*[]*string `field:"optional" json:"paths" yaml:"paths"` PreserveValueImports *bool `field:"optional" json:"preserveValueImports" yaml:"preserveValueImports"` Strict *bool `field:"optional" json:"strict" yaml:"strict"` Target *string `field:"optional" json:"target" yaml:"target"` UseDefineForClassFields *bool `field:"optional" json:"useDefineForClassFields" yaml:"useDefineForClassFields"` VerbatimModuleSyntax *bool `field:"optional" json:"verbatimModuleSyntax" yaml:"verbatimModuleSyntax"` }
type EsbuildBundler ¶
type EsbuildBundler interface { // A path or list or map of paths to the entry points of your code. // // Relative paths are by default resolved from the current working directory. // To change the working directory, see `buildOptions.absWorkingDir`. // // Absolute paths can be used if files are part of the working directory. // // Examples: // - `'src/index.ts'` // - `require.resolve('./lambda')` // - `['src/index.ts', 'src/util.ts']` // - `{one: 'src/two.ts', two: 'src/one.ts'}` // Experimental. EntryPoints() interface{} // Deprecated: This value is ignored since the bundler is always using a locally installed version of esbuild. However the property is required to comply with the `BundlingOptions` interface. Image() awscdk.DockerImage // Implementation of `ILocalBundling` interface, responsible for calling esbuild functions. // Experimental. Local() awscdk.ILocalBundling // Props to change the behavior of the bundler. // Experimental. Props() *BundlerProps }
Low-level construct that can be used where `BundlingOptions` are required.
This class directly interfaces with esbuild and provides almost no configuration safeguards. Experimental.
func NewEsbuildBundler ¶
func NewEsbuildBundler(entryPoints interface{}, props *BundlerProps) EsbuildBundler
Experimental.
type EsbuildProvider ¶
type EsbuildProvider interface { IBuildProvider ITransformProvider // A method implementing the code build. // // During synth time, the method will receive all computed `BuildOptions` from the bundler. // // It MUST implement any output options to integrate correctly and MAY use any other options. // On failure, it SHOULD print any warnings & errors to stderr and throw a `BuildFailure` to inform the bundler. BuildSync(options *ProviderBuildOptions) // A method implementing the inline code transformation. // // During synth time, the method will receive the inline code and all computed `TransformOptions` from the bundler. // // MUST return the transformed code as a string to integrate correctly. // It MAY use these options to do so. // On failure, it SHOULD print any warnings & errors to stderr and throw a `TransformFailure` to inform the bundler. TransformSync(input *string, options *ProviderTransformOptions) *string }
Default esbuild implementation calling esbuild's JavaScript API.
func NewEsbuildProvider ¶
func NewEsbuildProvider(props *EsbuildProviderProps) EsbuildProvider
type EsbuildProviderProps ¶
type EsbuildProviderProps struct { // Path to the binary used by esbuild. // // This is the same as setting the ESBUILD_BINARY_PATH environment variable. EsbuildBinaryPath *string `field:"optional" json:"esbuildBinaryPath" yaml:"esbuildBinaryPath"` // Absolute path to the esbuild module JS file. // // E.g. "/home/user/.npm/node_modules/esbuild/lib/main.js" // // If not set, the module path will be determined in the following order: // // - Use a path from the `CDK_ESBUILD_MODULE_PATH` environment variable // - In TypeScript, fallback to the default Node.js package resolution mechanism // - All other languages (Python, Go, .NET, Java) use an automatic "best effort" resolution mechanism. \ // The exact algorithm of this mechanism is considered an implementation detail and should not be relied on. // If `esbuild` cannot be found, it might be installed dynamically to a temporary location. // To opt-out of this behavior, set either `esbuildModulePath` or `CDK_ESBUILD_MODULE_PATH` env variable. // // Use the static methods on `EsbuildSource` to customize the default behavior. // Default: - `CDK_ESBUILD_MODULE_PATH` or package resolution (see description). // EsbuildModulePath *string `field:"optional" json:"esbuildModulePath" yaml:"esbuildModulePath"` }
Configure the default EsbuildProvider.
type EsbuildSource ¶
type EsbuildSource interface { }
type IBuildProvider ¶
type IBuildProvider interface { // A method implementing the code build. // // During synth time, the method will receive all computed `BuildOptions` from the bundler. // // It MUST implement any output options to integrate correctly and MAY use any other options. // On failure, it SHOULD print any warnings & errors to stderr and throw a `BuildFailure` to inform the bundler. BuildSync(options *ProviderBuildOptions) }
Provides an implementation of the esbuild Build API.
func EsbuildProvider_DefaultBuildProvider ¶
func EsbuildProvider_DefaultBuildProvider() IBuildProvider
Get the default implementation for the Build API.
type IEsbuildProvider ¶
type IEsbuildProvider interface { IBuildProvider ITransformProvider }
Provides an implementation of the esbuild Build & Transform API.
type ITransformProvider ¶
type ITransformProvider interface { // A method implementing the inline code transformation. // // During synth time, the method will receive the inline code and all computed `TransformOptions` from the bundler. // // MUST return the transformed code as a string to integrate correctly. // It MAY use these options to do so. // On failure, it SHOULD print any warnings & errors to stderr and throw a `TransformFailure` to inform the bundler. TransformSync(input *string, options *ProviderTransformOptions) *string }
Provides an implementation of the esbuild Transform API.
func EsbuildProvider_DefaultTransformationProvider ¶
func EsbuildProvider_DefaultTransformationProvider() ITransformProvider
Get the default implementation for the Transformation API.
type InlineJavaScriptCode ¶
type InlineJavaScriptCode interface { awslambda.InlineCode IsInline() *bool // Called when the lambda or layer is initialized to allow this object to bind to the stack, add resources and have fun. Bind(scope constructs.Construct) *awslambda.CodeConfig // Called after the CFN function resource has been created to allow the code class to bind to it. // // Specifically it's required to allow assets to add // metadata for tooling like SAM CLI to be able to find their origins. BindToResource(_resource awscdk.CfnResource, _options *awslambda.ResourceBindOptions) }
An implementation of `lambda.InlineCode` using the esbuild Transform API. Inline function code is limited to 4 KiB after transformation.
func NewInlineJavaScriptCode ¶
func NewInlineJavaScriptCode(code *string, props *TransformerProps) InlineJavaScriptCode
type InlineTypeScriptCode ¶
type InlineTypeScriptCode interface { awslambda.InlineCode IsInline() *bool // Called when the lambda or layer is initialized to allow this object to bind to the stack, add resources and have fun. Bind(scope constructs.Construct) *awslambda.CodeConfig // Called after the CFN function resource has been created to allow the code class to bind to it. // // Specifically it's required to allow assets to add // metadata for tooling like SAM CLI to be able to find their origins. BindToResource(_resource awscdk.CfnResource, _options *awslambda.ResourceBindOptions) }
An implementation of `lambda.InlineCode` using the esbuild Transform API. Inline function code is limited to 4 KiB after transformation.
func NewInlineTypeScriptCode ¶
func NewInlineTypeScriptCode(code *string, props *TransformerProps) InlineTypeScriptCode
type ProviderBuildOptions ¶
type ProviderBuildOptions struct { // Documentation: https://esbuild.github.io/api/#working-directory. AbsWorkingDir *string `field:"optional" json:"absWorkingDir" yaml:"absWorkingDir"` // Documentation: https://esbuild.github.io/api/#alias. Alias *map[string]*string `field:"optional" json:"alias" yaml:"alias"` // Documentation: https://esbuild.github.io/api/#allow-overwrite. AllowOverwrite *bool `field:"optional" json:"allowOverwrite" yaml:"allowOverwrite"` // Documentation: https://esbuild.github.io/api/#asset-names. AssetNames *string `field:"optional" json:"assetNames" yaml:"assetNames"` // Documentation: https://esbuild.github.io/api/#banner. Banner *map[string]*string `field:"optional" json:"banner" yaml:"banner"` // Documentation: https://esbuild.github.io/api/#bundle. Bundle *bool `field:"optional" json:"bundle" yaml:"bundle"` // Documentation: https://esbuild.github.io/api/#charset. Charset *string `field:"optional" json:"charset" yaml:"charset"` // Documentation: https://esbuild.github.io/api/#chunk-names. ChunkNames *string `field:"optional" json:"chunkNames" yaml:"chunkNames"` // Documentation: https://esbuild.github.io/api/#color. Color *bool `field:"optional" json:"color" yaml:"color"` // Documentation: https://esbuild.github.io/api/#conditions. Conditions *[]*string `field:"optional" json:"conditions" yaml:"conditions"` // Documentation: https://esbuild.github.io/api/#define. Define *map[string]*string `field:"optional" json:"define" yaml:"define"` // Documentation: https://esbuild.github.io/api/#drop. Drop *[]*string `field:"optional" json:"drop" yaml:"drop"` // Documentation: https://esbuild.github.io/api/#drop-labels. DropLabels *[]*string `field:"optional" json:"dropLabels" yaml:"dropLabels"` // Documentation: https://esbuild.github.io/api/#entry-names. EntryNames *string `field:"optional" json:"entryNames" yaml:"entryNames"` // Documentation: https://esbuild.github.io/api/#external. External *[]*string `field:"optional" json:"external" yaml:"external"` Footer *map[string]*string `field:"optional" json:"footer" yaml:"footer"` // Documentation: https://esbuild.github.io/api/#format. Format *string `field:"optional" json:"format" yaml:"format"` // Documentation: https://esbuild.github.io/api/#global-name. GlobalName *string `field:"optional" json:"globalName" yaml:"globalName"` // Documentation: https://esbuild.github.io/api/#ignore-annotations. IgnoreAnnotations *bool `field:"optional" json:"ignoreAnnotations" yaml:"ignoreAnnotations"` // Documentation: https://esbuild.github.io/api/#inject. Inject *[]*string `field:"optional" json:"inject" yaml:"inject"` // Documentation: https://esbuild.github.io/api/#jsx. Jsx *string `field:"optional" json:"jsx" yaml:"jsx"` // Documentation: https://esbuild.github.io/api/#jsx-development. JsxDev *bool `field:"optional" json:"jsxDev" yaml:"jsxDev"` // Documentation: https://esbuild.github.io/api/#jsx-factory. JsxFactory *string `field:"optional" json:"jsxFactory" yaml:"jsxFactory"` // Documentation: https://esbuild.github.io/api/#jsx-fragment. JsxFragment *string `field:"optional" json:"jsxFragment" yaml:"jsxFragment"` // Documentation: https://esbuild.github.io/api/#jsx-import-source. JsxImportSource *string `field:"optional" json:"jsxImportSource" yaml:"jsxImportSource"` // Documentation: https://esbuild.github.io/api/#jsx-side-effects. JsxSideEffects *bool `field:"optional" json:"jsxSideEffects" yaml:"jsxSideEffects"` // Documentation: https://esbuild.github.io/api/#keep-names. KeepNames *bool `field:"optional" json:"keepNames" yaml:"keepNames"` // Documentation: https://esbuild.github.io/api/#legal-comments. LegalComments *string `field:"optional" json:"legalComments" yaml:"legalComments"` // Documentation: https://esbuild.github.io/api/#line-limit. LineLimit *float64 `field:"optional" json:"lineLimit" yaml:"lineLimit"` // Documentation: https://esbuild.github.io/api/#loader. Loader *map[string]*string `field:"optional" json:"loader" yaml:"loader"` // Documentation: https://esbuild.github.io/api/#log-level. LogLevel *string `field:"optional" json:"logLevel" yaml:"logLevel"` // Documentation: https://esbuild.github.io/api/#log-limit. LogLimit *float64 `field:"optional" json:"logLimit" yaml:"logLimit"` // Documentation: https://esbuild.github.io/api/#log-override. LogOverride *map[string]*string `field:"optional" json:"logOverride" yaml:"logOverride"` // Documentation: https://esbuild.github.io/api/#main-fields. MainFields *[]*string `field:"optional" json:"mainFields" yaml:"mainFields"` // Documentation: https://esbuild.github.io/api/#mangle-props. MangleCache *map[string]interface{} `field:"optional" json:"mangleCache" yaml:"mangleCache"` // Documentation: https://esbuild.github.io/api/#mangle-props. MangleProps interface{} `field:"optional" json:"mangleProps" yaml:"mangleProps"` // Documentation: https://esbuild.github.io/api/#mangle-props. MangleQuoted *bool `field:"optional" json:"mangleQuoted" yaml:"mangleQuoted"` // Documentation: https://esbuild.github.io/api/#metafile. Metafile *bool `field:"optional" json:"metafile" yaml:"metafile"` // Documentation: https://esbuild.github.io/api/#minify. Minify *bool `field:"optional" json:"minify" yaml:"minify"` // Documentation: https://esbuild.github.io/api/#minify. MinifyIdentifiers *bool `field:"optional" json:"minifyIdentifiers" yaml:"minifyIdentifiers"` // Documentation: https://esbuild.github.io/api/#minify. MinifySyntax *bool `field:"optional" json:"minifySyntax" yaml:"minifySyntax"` // Documentation: https://esbuild.github.io/api/#minify. MinifyWhitespace *bool `field:"optional" json:"minifyWhitespace" yaml:"minifyWhitespace"` // Documentation: https://esbuild.github.io/api/#node-paths. NodePaths *[]*string `field:"optional" json:"nodePaths" yaml:"nodePaths"` // Documentation: https://esbuild.github.io/api/#outbase. Outbase *string `field:"optional" json:"outbase" yaml:"outbase"` // Documentation: https://esbuild.github.io/api/#outdir. Outdir *string `field:"optional" json:"outdir" yaml:"outdir"` // Documentation: https://esbuild.github.io/api/#out-extension. OutExtension *map[string]*string `field:"optional" json:"outExtension" yaml:"outExtension"` // Documentation: https://esbuild.github.io/api/#outfile. Outfile *string `field:"optional" json:"outfile" yaml:"outfile"` // Documentation: https://esbuild.github.io/api/#packages. Packages *string `field:"optional" json:"packages" yaml:"packages"` // Documentation: https://esbuild.github.io/api/#platform. Platform *string `field:"optional" json:"platform" yaml:"platform"` // Documentation: https://esbuild.github.io/api/#preserve-symlinks. PreserveSymlinks *bool `field:"optional" json:"preserveSymlinks" yaml:"preserveSymlinks"` // Documentation: https://esbuild.github.io/api/#public-path. PublicPath *string `field:"optional" json:"publicPath" yaml:"publicPath"` // Documentation: https://esbuild.github.io/api/#pure. Pure *[]*string `field:"optional" json:"pure" yaml:"pure"` // Documentation: https://esbuild.github.io/api/#mangle-props. ReserveProps interface{} `field:"optional" json:"reserveProps" yaml:"reserveProps"` // Documentation: https://esbuild.github.io/api/#resolve-extensions. ResolveExtensions *[]*string `field:"optional" json:"resolveExtensions" yaml:"resolveExtensions"` // Documentation: https://esbuild.github.io/api/#sourcemap. Sourcemap interface{} `field:"optional" json:"sourcemap" yaml:"sourcemap"` // Documentation: https://esbuild.github.io/api/#source-root. SourceRoot *string `field:"optional" json:"sourceRoot" yaml:"sourceRoot"` // Documentation: https://esbuild.github.io/api/#sources-content. SourcesContent *bool `field:"optional" json:"sourcesContent" yaml:"sourcesContent"` // Documentation: https://esbuild.github.io/api/#splitting. Splitting *bool `field:"optional" json:"splitting" yaml:"splitting"` // Documentation: https://esbuild.github.io/api/#supported. Supported *map[string]*bool `field:"optional" json:"supported" yaml:"supported"` // Documentation: https://esbuild.github.io/api/#target. Target interface{} `field:"optional" json:"target" yaml:"target"` // Documentation: https://esbuild.github.io/api/#tree-shaking. TreeShaking *bool `field:"optional" json:"treeShaking" yaml:"treeShaking"` // Documentation: https://esbuild.github.io/api/#tsconfig. Tsconfig *string `field:"optional" json:"tsconfig" yaml:"tsconfig"` // Documentation: https://esbuild.github.io/api/#tsconfig-raw. TsconfigRaw interface{} `field:"optional" json:"tsconfigRaw" yaml:"tsconfigRaw"` // Documentation: https://esbuild.github.io/api/#write. Write *bool `field:"optional" json:"write" yaml:"write"` // Documentation: https://esbuild.github.io/api/#entry-points. EntryPoints interface{} `field:"optional" json:"entryPoints" yaml:"entryPoints"` }
type ProviderTransformOptions ¶
type ProviderTransformOptions struct { // Documentation: https://esbuild.github.io/api/#banner. Banner *string `field:"optional" json:"banner" yaml:"banner"` // Documentation: https://esbuild.github.io/api/#charset. Charset *string `field:"optional" json:"charset" yaml:"charset"` // Documentation: https://esbuild.github.io/api/#color. Color *bool `field:"optional" json:"color" yaml:"color"` // Documentation: https://esbuild.github.io/api/#define. Define *map[string]*string `field:"optional" json:"define" yaml:"define"` // Documentation: https://esbuild.github.io/api/#drop. Drop *[]*string `field:"optional" json:"drop" yaml:"drop"` // Documentation: https://esbuild.github.io/api/#drop-labels. DropLabels *[]*string `field:"optional" json:"dropLabels" yaml:"dropLabels"` Footer *string `field:"optional" json:"footer" yaml:"footer"` // Documentation: https://esbuild.github.io/api/#format. Format *string `field:"optional" json:"format" yaml:"format"` // Documentation: https://esbuild.github.io/api/#global-name. GlobalName *string `field:"optional" json:"globalName" yaml:"globalName"` // Documentation: https://esbuild.github.io/api/#ignore-annotations. IgnoreAnnotations *bool `field:"optional" json:"ignoreAnnotations" yaml:"ignoreAnnotations"` // Documentation: https://esbuild.github.io/api/#jsx. Jsx *string `field:"optional" json:"jsx" yaml:"jsx"` // Documentation: https://esbuild.github.io/api/#jsx-development. JsxDev *bool `field:"optional" json:"jsxDev" yaml:"jsxDev"` // Documentation: https://esbuild.github.io/api/#jsx-factory. JsxFactory *string `field:"optional" json:"jsxFactory" yaml:"jsxFactory"` // Documentation: https://esbuild.github.io/api/#jsx-fragment. JsxFragment *string `field:"optional" json:"jsxFragment" yaml:"jsxFragment"` // Documentation: https://esbuild.github.io/api/#jsx-import-source. JsxImportSource *string `field:"optional" json:"jsxImportSource" yaml:"jsxImportSource"` // Documentation: https://esbuild.github.io/api/#jsx-side-effects. JsxSideEffects *bool `field:"optional" json:"jsxSideEffects" yaml:"jsxSideEffects"` // Documentation: https://esbuild.github.io/api/#keep-names. KeepNames *bool `field:"optional" json:"keepNames" yaml:"keepNames"` // Documentation: https://esbuild.github.io/api/#legal-comments. LegalComments *string `field:"optional" json:"legalComments" yaml:"legalComments"` // Documentation: https://esbuild.github.io/api/#line-limit. LineLimit *float64 `field:"optional" json:"lineLimit" yaml:"lineLimit"` // Documentation: https://esbuild.github.io/api/#loader. Loader *string `field:"optional" json:"loader" yaml:"loader"` // Documentation: https://esbuild.github.io/api/#log-level. LogLevel *string `field:"optional" json:"logLevel" yaml:"logLevel"` // Documentation: https://esbuild.github.io/api/#log-limit. LogLimit *float64 `field:"optional" json:"logLimit" yaml:"logLimit"` // Documentation: https://esbuild.github.io/api/#log-override. LogOverride *map[string]*string `field:"optional" json:"logOverride" yaml:"logOverride"` // Documentation: https://esbuild.github.io/api/#mangle-props. MangleCache *map[string]interface{} `field:"optional" json:"mangleCache" yaml:"mangleCache"` // Documentation: https://esbuild.github.io/api/#mangle-props. MangleProps interface{} `field:"optional" json:"mangleProps" yaml:"mangleProps"` // Documentation: https://esbuild.github.io/api/#mangle-props. MangleQuoted *bool `field:"optional" json:"mangleQuoted" yaml:"mangleQuoted"` // Documentation: https://esbuild.github.io/api/#minify. Minify *bool `field:"optional" json:"minify" yaml:"minify"` // Documentation: https://esbuild.github.io/api/#minify. MinifyIdentifiers *bool `field:"optional" json:"minifyIdentifiers" yaml:"minifyIdentifiers"` // Documentation: https://esbuild.github.io/api/#minify. MinifySyntax *bool `field:"optional" json:"minifySyntax" yaml:"minifySyntax"` // Documentation: https://esbuild.github.io/api/#minify. MinifyWhitespace *bool `field:"optional" json:"minifyWhitespace" yaml:"minifyWhitespace"` // Documentation: https://esbuild.github.io/api/#platform. Platform *string `field:"optional" json:"platform" yaml:"platform"` // Documentation: https://esbuild.github.io/api/#pure. Pure *[]*string `field:"optional" json:"pure" yaml:"pure"` // Documentation: https://esbuild.github.io/api/#mangle-props. ReserveProps interface{} `field:"optional" json:"reserveProps" yaml:"reserveProps"` // Documentation: https://esbuild.github.io/api/#sourcefile. Sourcefile *string `field:"optional" json:"sourcefile" yaml:"sourcefile"` // Documentation: https://esbuild.github.io/api/#sourcemap. Sourcemap interface{} `field:"optional" json:"sourcemap" yaml:"sourcemap"` // Documentation: https://esbuild.github.io/api/#source-root. SourceRoot *string `field:"optional" json:"sourceRoot" yaml:"sourceRoot"` // Documentation: https://esbuild.github.io/api/#sources-content. SourcesContent *bool `field:"optional" json:"sourcesContent" yaml:"sourcesContent"` // Documentation: https://esbuild.github.io/api/#supported. Supported *map[string]*bool `field:"optional" json:"supported" yaml:"supported"` // Documentation: https://esbuild.github.io/api/#target. Target interface{} `field:"optional" json:"target" yaml:"target"` // Documentation: https://esbuild.github.io/api/#tree-shaking. TreeShaking *bool `field:"optional" json:"treeShaking" yaml:"treeShaking"` // Documentation: https://esbuild.github.io/api/#tsconfig-raw. TsconfigRaw interface{} `field:"optional" json:"tsconfigRaw" yaml:"tsconfigRaw"` }
type TransformOptions ¶
type TransformOptions struct { // Documentation: https://esbuild.github.io/api/#banner. Banner *string `field:"optional" json:"banner" yaml:"banner"` // Documentation: https://esbuild.github.io/api/#charset. Charset *string `field:"optional" json:"charset" yaml:"charset"` // Documentation: https://esbuild.github.io/api/#color. Color *bool `field:"optional" json:"color" yaml:"color"` // Documentation: https://esbuild.github.io/api/#define. Define *map[string]*string `field:"optional" json:"define" yaml:"define"` // Documentation: https://esbuild.github.io/api/#drop. Drop *[]*string `field:"optional" json:"drop" yaml:"drop"` // Documentation: https://esbuild.github.io/api/#drop-labels. DropLabels *[]*string `field:"optional" json:"dropLabels" yaml:"dropLabels"` Footer *string `field:"optional" json:"footer" yaml:"footer"` // Documentation: https://esbuild.github.io/api/#format. Format *string `field:"optional" json:"format" yaml:"format"` // Documentation: https://esbuild.github.io/api/#global-name. GlobalName *string `field:"optional" json:"globalName" yaml:"globalName"` // Documentation: https://esbuild.github.io/api/#ignore-annotations. IgnoreAnnotations *bool `field:"optional" json:"ignoreAnnotations" yaml:"ignoreAnnotations"` // Documentation: https://esbuild.github.io/api/#jsx. Jsx *string `field:"optional" json:"jsx" yaml:"jsx"` // Documentation: https://esbuild.github.io/api/#jsx-development. JsxDev *bool `field:"optional" json:"jsxDev" yaml:"jsxDev"` // Documentation: https://esbuild.github.io/api/#jsx-factory. JsxFactory *string `field:"optional" json:"jsxFactory" yaml:"jsxFactory"` // Documentation: https://esbuild.github.io/api/#jsx-fragment. JsxFragment *string `field:"optional" json:"jsxFragment" yaml:"jsxFragment"` // Documentation: https://esbuild.github.io/api/#jsx-import-source. JsxImportSource *string `field:"optional" json:"jsxImportSource" yaml:"jsxImportSource"` // Documentation: https://esbuild.github.io/api/#jsx-side-effects. JsxSideEffects *bool `field:"optional" json:"jsxSideEffects" yaml:"jsxSideEffects"` // Documentation: https://esbuild.github.io/api/#keep-names. KeepNames *bool `field:"optional" json:"keepNames" yaml:"keepNames"` // Documentation: https://esbuild.github.io/api/#legal-comments. LegalComments *string `field:"optional" json:"legalComments" yaml:"legalComments"` // Documentation: https://esbuild.github.io/api/#line-limit. LineLimit *float64 `field:"optional" json:"lineLimit" yaml:"lineLimit"` // Documentation: https://esbuild.github.io/api/#loader. Loader *string `field:"optional" json:"loader" yaml:"loader"` // Documentation: https://esbuild.github.io/api/#log-level. LogLevel *string `field:"optional" json:"logLevel" yaml:"logLevel"` // Documentation: https://esbuild.github.io/api/#log-limit. LogLimit *float64 `field:"optional" json:"logLimit" yaml:"logLimit"` // Documentation: https://esbuild.github.io/api/#log-override. LogOverride *map[string]*string `field:"optional" json:"logOverride" yaml:"logOverride"` // Documentation: https://esbuild.github.io/api/#mangle-props. MangleCache *map[string]interface{} `field:"optional" json:"mangleCache" yaml:"mangleCache"` // Documentation: https://esbuild.github.io/api/#mangle-props. MangleProps interface{} `field:"optional" json:"mangleProps" yaml:"mangleProps"` // Documentation: https://esbuild.github.io/api/#mangle-props. MangleQuoted *bool `field:"optional" json:"mangleQuoted" yaml:"mangleQuoted"` // Documentation: https://esbuild.github.io/api/#minify. Minify *bool `field:"optional" json:"minify" yaml:"minify"` // Documentation: https://esbuild.github.io/api/#minify. MinifyIdentifiers *bool `field:"optional" json:"minifyIdentifiers" yaml:"minifyIdentifiers"` // Documentation: https://esbuild.github.io/api/#minify. MinifySyntax *bool `field:"optional" json:"minifySyntax" yaml:"minifySyntax"` // Documentation: https://esbuild.github.io/api/#minify. MinifyWhitespace *bool `field:"optional" json:"minifyWhitespace" yaml:"minifyWhitespace"` // Documentation: https://esbuild.github.io/api/#platform. Platform *string `field:"optional" json:"platform" yaml:"platform"` // Documentation: https://esbuild.github.io/api/#pure. Pure *[]*string `field:"optional" json:"pure" yaml:"pure"` // Documentation: https://esbuild.github.io/api/#mangle-props. ReserveProps interface{} `field:"optional" json:"reserveProps" yaml:"reserveProps"` // Documentation: https://esbuild.github.io/api/#sourcefile. Sourcefile *string `field:"optional" json:"sourcefile" yaml:"sourcefile"` // Documentation: https://esbuild.github.io/api/#sourcemap. Sourcemap interface{} `field:"optional" json:"sourcemap" yaml:"sourcemap"` // Documentation: https://esbuild.github.io/api/#source-root. SourceRoot *string `field:"optional" json:"sourceRoot" yaml:"sourceRoot"` // Documentation: https://esbuild.github.io/api/#sources-content. SourcesContent *bool `field:"optional" json:"sourcesContent" yaml:"sourcesContent"` // Documentation: https://esbuild.github.io/api/#supported. Supported *map[string]*bool `field:"optional" json:"supported" yaml:"supported"` // Documentation: https://esbuild.github.io/api/#target. Target interface{} `field:"optional" json:"target" yaml:"target"` // Documentation: https://esbuild.github.io/api/#tree-shaking. TreeShaking *bool `field:"optional" json:"treeShaking" yaml:"treeShaking"` // Documentation: https://esbuild.github.io/api/#tsconfig-raw. TsconfigRaw interface{} `field:"optional" json:"tsconfigRaw" yaml:"tsconfigRaw"` }
type TransformerProps ¶
type TransformerProps struct { // Transform options passed on to esbuild. // // Please refer to the esbuild Transform API docs for details. // See: https://esbuild.github.io/api/#transform-api // TransformOptions *TransformOptions `field:"optional" json:"transformOptions" yaml:"transformOptions"` // The esbuild Transform API implementation to be used. // // Configure the default `EsbuildProvider` for more options or // provide a custom `ITransformProvider` as an escape hatch. // Default: new DefaultEsbuildProvider(). // TransformProvider ITransformProvider `field:"optional" json:"transformProvider" yaml:"transformProvider"` }
type TsconfigRaw ¶
type TsconfigRaw struct {
CompilerOptions *CompilerOptions `field:"optional" json:"compilerOptions" yaml:"compilerOptions"`
}
type TypeScriptAsset ¶
type TypeScriptAsset interface { awss3assets.Asset // A hash of this asset, which is available at construction time. // // As this is a plain string, it // can be used in construct IDs in order to enforce creation of a new resource when the content // hash has changed. AssetHash() *string // The path to the asset, relative to the current Cloud Assembly. // // If asset staging is disabled, this will just be the original path. // If asset staging is enabled it will be the staged path. AssetPath() *string // The S3 bucket in which this asset resides. Bucket() awss3.IBucket // Attribute which represents the S3 HTTP URL of this asset. // // For example, `https://s3.us-west-1.amazonaws.com/bucket/key` HttpUrl() *string // Indicates if this asset is a single file. // // Allows constructs to ensure that the // correct file type was used. IsFile() *bool // Indicates if this asset is a zip archive. // // Allows constructs to ensure that the // correct file type was used. IsZipArchive() *bool // The tree node. Node() constructs.Node // Attribute that represents the name of the bucket this asset exists in. S3BucketName() *string // Attribute which represents the S3 object key of this asset. S3ObjectKey() *string // Attribute which represents the S3 URL of this asset. // // For example, `s3://bucket/key`. S3ObjectUrl() *string // Adds CloudFormation template metadata to the specified resource with information that indicates which resource property is mapped to this local asset. // // This can be used by tools such as SAM CLI to provide local // experience such as local invocation and debugging of Lambda functions. // // Asset metadata will only be included if the stack is synthesized with the // "aws:cdk:enable-asset-metadata" context key defined, which is the default // behavior when synthesizing via the CDK Toolkit. // See: https://github.com/aws/aws-cdk/issues/1432 // AddResourceMetadata(resource awscdk.CfnResource, resourceProperty *string) // Grants read permissions to the principal on the assets bucket. GrantRead(grantee awsiam.IGrantable) // Returns a string representation of this construct. ToString() *string }
Bundles the entry points and creates a CDK asset which is uploaded to the bootstrapped CDK S3 bucket during deployment.
The asset can be used by other constructs.
func NewTypeScriptAsset ¶
func NewTypeScriptAsset(scope constructs.Construct, id *string, props *TypeScriptAssetProps) TypeScriptAsset
type TypeScriptAssetProps ¶
type TypeScriptAssetProps struct { // Build options passed on to esbuild. Please refer to the esbuild Build API docs for details. // // * `buildOptions.outdir: string` // The actual path for the output directory is defined by CDK. However setting this option allows to write files into a subdirectory. \ // For example `{ outdir: 'js' }` will create an asset with a single directory called `js`, which contains all built files. This approach can be useful for static website deployments, where JavaScript code should be placed into a subdirectory. \ // *Cannot be used together with `outfile`*. // * `buildOptions.outfile: string` // Relative path to a file inside the CDK asset output directory. // For example `{ outfile: 'js/index.js' }` will create an asset with a single directory called `js`, which contains a single file `index.js`. This can be useful to rename the entry point. \ // *Cannot be used with multiple entryPoints or together with `outdir`.* // * `buildOptions.absWorkingDir: string` // Absolute path to the [esbuild working directory](https://esbuild.github.io/api/#working-directory) and defaults to the [current working directory](https://en.wikipedia.org/wiki/Working_directory). \ // If paths cannot be found, a good starting point is to look at the concatenation of `absWorkingDir + entryPoint`. It must always be a valid absolute path pointing to the entry point. When needed, the probably easiest way to set absWorkingDir is to use a combination of `resolve` and `__dirname` (see "Library authors" section in the documentation). // See: https://esbuild.github.io/api/#build-api // BuildOptions *BuildOptions `field:"optional" json:"buildOptions" yaml:"buildOptions"` // The esbuild Build API implementation to be used. // // Configure the default `EsbuildProvider` for more options or // provide a custom `IBuildProvider` as an escape hatch. // Default: new EsbuildProvider(). // BuildProvider IBuildProvider `field:"optional" json:"buildProvider" yaml:"buildProvider"` // Copy additional files to the code [asset staging directory](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.AssetStaging.html#absolutestagedpath), before the build runs. Files copied like this will be overwritten by esbuild if they share the same name as any of the outputs. // // * When provided with a `string` or `array`, all files are copied to the root of asset staging directory. // * When given a `map`, the key indicates the destination relative to the asset staging directory and the value is a list of all sources to be copied. // // Therefore the following values for `copyDir` are all equivalent: // “` // { copyDir: "path/to/source" } // { copyDir: ["path/to/source"] } // { copyDir: { ".": "path/to/source" } } // { copyDir: { ".": ["path/to/source"] } } // “` // The destination cannot be outside of the asset staging directory. // If you are receiving the error "Cannot copy files to outside of the asset staging directory." // you are likely using `..` or an absolute path as key on the `copyDir` map. // Instead use only relative paths and avoid `..`. CopyDir interface{} `field:"optional" json:"copyDir" yaml:"copyDir"` // A hash of this asset, which is available at construction time. // // As this is a plain string, it can be used in construct IDs in order to enforce creation of a new resource when the content hash has changed. // // Defaults to a hash of all files in the resulting bundle. AssetHash *string `field:"optional" json:"assetHash" yaml:"assetHash"` // A path or list or map of paths to the entry points of your code. // // Relative paths are by default resolved from the current working directory. // To change the working directory, see `buildOptions.absWorkingDir`. // // Absolute paths can be used if files are part of the working directory. // // Examples: // - `'src/index.ts'` // - `require.resolve('./lambda')` // - `['src/index.ts', 'src/util.ts']` // - `{one: 'src/two.ts', two: 'src/one.ts'}` EntryPoints interface{} `field:"required" json:"entryPoints" yaml:"entryPoints"` }
type TypeScriptCode ¶
type TypeScriptCode interface { awslambda.Code // Determines whether this Code is inline code or not. // Deprecated: this value is ignored since inline is now determined based on the the inlineCode field of CodeConfig returned from bind(). IsInline() *bool // Deprecated: this value is ignored since inline is now determined based on the the inlineCode field of CodeConfig returned from bind(). SetIsInline(val *bool) // Called when the lambda or layer is initialized to allow this object to bind to the stack, add resources and have fun. Bind(scope constructs.Construct) *awslambda.CodeConfig // Called after the CFN function resource has been created to allow the code class to bind to it. // // Specifically it's required to allow assets to add // metadata for tooling like SAM CLI to be able to find their origins. BindToResource(resource awscdk.CfnResource, options *awslambda.ResourceBindOptions) }
Represents the deployed TypeScript Code.
func NewTypeScriptCode ¶
func NewTypeScriptCode(entryPoints interface{}, props *TypeScriptCodeProps) TypeScriptCode
type TypeScriptCodeProps ¶
type TypeScriptCodeProps struct { // Build options passed on to esbuild. Please refer to the esbuild Build API docs for details. // // * `buildOptions.outdir: string` // The actual path for the output directory is defined by CDK. However setting this option allows to write files into a subdirectory. \ // For example `{ outdir: 'js' }` will create an asset with a single directory called `js`, which contains all built files. This approach can be useful for static website deployments, where JavaScript code should be placed into a subdirectory. \ // *Cannot be used together with `outfile`*. // * `buildOptions.outfile: string` // Relative path to a file inside the CDK asset output directory. // For example `{ outfile: 'js/index.js' }` will create an asset with a single directory called `js`, which contains a single file `index.js`. This can be useful to rename the entry point. \ // *Cannot be used with multiple entryPoints or together with `outdir`.* // * `buildOptions.absWorkingDir: string` // Absolute path to the [esbuild working directory](https://esbuild.github.io/api/#working-directory) and defaults to the [current working directory](https://en.wikipedia.org/wiki/Working_directory). \ // If paths cannot be found, a good starting point is to look at the concatenation of `absWorkingDir + entryPoint`. It must always be a valid absolute path pointing to the entry point. When needed, the probably easiest way to set absWorkingDir is to use a combination of `resolve` and `__dirname` (see "Library authors" section in the documentation). // See: https://esbuild.github.io/api/#build-api // BuildOptions *BuildOptions `field:"optional" json:"buildOptions" yaml:"buildOptions"` // The esbuild Build API implementation to be used. // // Configure the default `EsbuildProvider` for more options or // provide a custom `IBuildProvider` as an escape hatch. // Default: new EsbuildProvider(). // BuildProvider IBuildProvider `field:"optional" json:"buildProvider" yaml:"buildProvider"` // Copy additional files to the code [asset staging directory](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.AssetStaging.html#absolutestagedpath), before the build runs. Files copied like this will be overwritten by esbuild if they share the same name as any of the outputs. // // * When provided with a `string` or `array`, all files are copied to the root of asset staging directory. // * When given a `map`, the key indicates the destination relative to the asset staging directory and the value is a list of all sources to be copied. // // Therefore the following values for `copyDir` are all equivalent: // “` // { copyDir: "path/to/source" } // { copyDir: ["path/to/source"] } // { copyDir: { ".": "path/to/source" } } // { copyDir: { ".": ["path/to/source"] } } // “` // The destination cannot be outside of the asset staging directory. // If you are receiving the error "Cannot copy files to outside of the asset staging directory." // you are likely using `..` or an absolute path as key on the `copyDir` map. // Instead use only relative paths and avoid `..`. CopyDir interface{} `field:"optional" json:"copyDir" yaml:"copyDir"` // A hash of this asset, which is available at construction time. // // As this is a plain string, it can be used in construct IDs in order to enforce creation of a new resource when the content hash has changed. // // Defaults to a hash of all files in the resulting bundle. AssetHash *string `field:"optional" json:"assetHash" yaml:"assetHash"` }
type TypeScriptSource ¶
type TypeScriptSource interface { awss3deployment.ISource // Binds the source to a bucket deployment. Bind(scope constructs.Construct, context *awss3deployment.DeploymentSourceContext) *awss3deployment.SourceConfig }
func NewTypeScriptSource ¶
func NewTypeScriptSource(entryPoints interface{}, props *TypeScriptSourceProps) TypeScriptSource
type TypeScriptSourceProps ¶
type TypeScriptSourceProps struct { // Build options passed on to esbuild. Please refer to the esbuild Build API docs for details. // // * `buildOptions.outdir: string` // The actual path for the output directory is defined by CDK. However setting this option allows to write files into a subdirectory. \ // For example `{ outdir: 'js' }` will create an asset with a single directory called `js`, which contains all built files. This approach can be useful for static website deployments, where JavaScript code should be placed into a subdirectory. \ // *Cannot be used together with `outfile`*. // * `buildOptions.outfile: string` // Relative path to a file inside the CDK asset output directory. // For example `{ outfile: 'js/index.js' }` will create an asset with a single directory called `js`, which contains a single file `index.js`. This can be useful to rename the entry point. \ // *Cannot be used with multiple entryPoints or together with `outdir`.* // * `buildOptions.absWorkingDir: string` // Absolute path to the [esbuild working directory](https://esbuild.github.io/api/#working-directory) and defaults to the [current working directory](https://en.wikipedia.org/wiki/Working_directory). \ // If paths cannot be found, a good starting point is to look at the concatenation of `absWorkingDir + entryPoint`. It must always be a valid absolute path pointing to the entry point. When needed, the probably easiest way to set absWorkingDir is to use a combination of `resolve` and `__dirname` (see "Library authors" section in the documentation). // See: https://esbuild.github.io/api/#build-api // BuildOptions *BuildOptions `field:"optional" json:"buildOptions" yaml:"buildOptions"` // The esbuild Build API implementation to be used. // // Configure the default `EsbuildProvider` for more options or // provide a custom `IBuildProvider` as an escape hatch. // Default: new EsbuildProvider(). // BuildProvider IBuildProvider `field:"optional" json:"buildProvider" yaml:"buildProvider"` // Copy additional files to the code [asset staging directory](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.AssetStaging.html#absolutestagedpath), before the build runs. Files copied like this will be overwritten by esbuild if they share the same name as any of the outputs. // // * When provided with a `string` or `array`, all files are copied to the root of asset staging directory. // * When given a `map`, the key indicates the destination relative to the asset staging directory and the value is a list of all sources to be copied. // // Therefore the following values for `copyDir` are all equivalent: // “` // { copyDir: "path/to/source" } // { copyDir: ["path/to/source"] } // { copyDir: { ".": "path/to/source" } } // { copyDir: { ".": ["path/to/source"] } } // “` // The destination cannot be outside of the asset staging directory. // If you are receiving the error "Cannot copy files to outside of the asset staging directory." // you are likely using `..` or an absolute path as key on the `copyDir` map. // Instead use only relative paths and avoid `..`. CopyDir interface{} `field:"optional" json:"copyDir" yaml:"copyDir"` // A hash of this asset, which is available at construction time. // // As this is a plain string, it can be used in construct IDs in order to enforce creation of a new resource when the content hash has changed. // // Defaults to a hash of all files in the resulting bundle. AssetHash *string `field:"optional" json:"assetHash" yaml:"assetHash"` }
Source Files ¶
- BuildOptions.go
- BundlerProps.go
- CodeConfig.go
- CompilerOptions.go
- EsbuildBundler.go
- EsbuildBundler__checks.go
- EsbuildProvider.go
- EsbuildProviderProps.go
- EsbuildProvider__checks.go
- EsbuildSource.go
- IBuildProvider.go
- IBuildProvider__checks.go
- IEsbuildProvider.go
- ITransformProvider.go
- ITransformProvider__checks.go
- InlineJavaScriptCode.go
- InlineJavaScriptCode__checks.go
- InlineTypeScriptCode.go
- InlineTypeScriptCode__checks.go
- ProviderBuildOptions.go
- ProviderTransformOptions.go
- TransformOptions.go
- TransformerProps.go
- TsconfigRaw.go
- TypeScriptAsset.go
- TypeScriptAssetProps.go
- TypeScriptAsset__checks.go
- TypeScriptCode.go
- TypeScriptCodeProps.go
- TypeScriptCode__checks.go
- TypeScriptSource.go
- TypeScriptSourceProps.go
- TypeScriptSource__checks.go
- main.go