@Stability(value=Experimental) @Internal public static final class BundlingOptions.Jsii$Proxy extends software.amazon.jsii.JsiiObject implements BundlingOptions
BundlingOptionssoftware.amazon.jsii.JsiiObject.InitializationModeBundlingOptions.Builder, BundlingOptions.Jsii$Proxy| Modifier | Constructor and Description |
|---|---|
protected |
Jsii$Proxy(software.amazon.jsii.JsiiObjectRef objRef)
Constructor that initializes the object based on values retrieved from the JsiiObject.
|
protected |
Jsii$Proxy(String banner,
Map<String,String> buildArgs,
ICommandHooks commandHooks,
Map<String,String> define,
DockerImage dockerImage,
Map<String,String> environment,
String esbuildVersion,
List<String> externalModules,
String footer,
Boolean forceDockerBundling,
Boolean keepNames,
Map<String,String> loader,
LogLevel logLevel,
Boolean metafile,
Boolean minify,
List<String> nodeModules,
Boolean sourceMap,
String target,
String tsconfig)
Constructor that initializes the object based on literal property values passed by the
BundlingOptions.Builder. |
| Modifier and Type | Method and Description |
|---|---|
com.fasterxml.jackson.databind.JsonNode |
$jsii$toJson() |
boolean |
equals(Object o) |
String |
getBanner()
(experimental) Use this to insert an arbitrary string at the beginning of generated JavaScript files.
|
Map<String,String> |
getBuildArgs()
(experimental) Build arguments to pass when building the bundling image.
|
ICommandHooks |
getCommandHooks()
(experimental) Command hooks.
|
Map<String,String> |
getDefine()
(experimental) Replace global identifiers with constant expressions.
|
DockerImage |
getDockerImage()
(experimental) A custom bundling Docker image.
|
Map<String,String> |
getEnvironment()
(experimental) Environment variables defined when bundling runs.
|
String |
getEsbuildVersion()
(experimental) The version of esbuild to use when running in a Docker container.
|
List<String> |
getExternalModules()
(experimental) A list of modules that should be considered as externals (already available in the runtime).
|
String |
getFooter()
(experimental) Use this to insert an arbitrary string at the end of generated JavaScript files.
|
Boolean |
getForceDockerBundling()
(experimental) Force bundling in a Docker container even if local bundling is possible.
|
Boolean |
getKeepNames()
(experimental) Whether to preserve the original `name` values even in minified code.
|
Map<String,String> |
getLoader()
(experimental) Use loaders to change how a given input file is interpreted.
|
LogLevel |
getLogLevel()
(experimental) Log level for esbuild.
|
Boolean |
getMetafile()
(experimental) This option tells esbuild to write out a JSON file relative to output directory with metadata about the build.
|
Boolean |
getMinify()
(experimental) Whether to minify files when bundling.
|
List<String> |
getNodeModules()
(experimental) A list of modules that should be installed instead of bundled.
|
Boolean |
getSourceMap()
(experimental) Whether to include source maps when bundling.
|
String |
getTarget()
(experimental) Target environment for the generated JavaScript code.
|
String |
getTsconfig()
(experimental) Normally the esbuild automatically discovers `tsconfig.json` files and reads their contents during a build.
|
int |
hashCode() |
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitbuilderprotected Jsii$Proxy(software.amazon.jsii.JsiiObjectRef objRef)
objRef - Reference to the JSII managed object.protected Jsii$Proxy(String banner, Map<String,String> buildArgs, ICommandHooks commandHooks, Map<String,String> define, DockerImage dockerImage, Map<String,String> environment, String esbuildVersion, List<String> externalModules, String footer, Boolean forceDockerBundling, Boolean keepNames, Map<String,String> loader, LogLevel logLevel, Boolean metafile, Boolean minify, List<String> nodeModules, Boolean sourceMap, String target, String tsconfig)
BundlingOptions.Builder.public final String getBanner()
BundlingOptionsThis is similar to footer which inserts at the end instead of the beginning.
This is commonly used to insert comments:
Default: - no comments are passed
getBanner in interface BundlingOptionspublic final Map<String,String> getBuildArgs()
BundlingOptionsDefault: - no build arguments are passed
getBuildArgs in interface BundlingOptionspublic final ICommandHooks getCommandHooks()
BundlingOptionsDefault: - do not run additional commands
getCommandHooks in interface BundlingOptionspublic final Map<String,String> getDefine()
BundlingOptionsDefault: - no replacements are made
Example:
// Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826 {"process.env.API_KEY";JSON.stringify("xxx-xxxx-xxx"); }
getDefine in interface BundlingOptionspublic final DockerImage getDockerImage()
BundlingOptions
This image should have esbuild installed globally. If you plan to use nodeModules
it should also have npm or yarn depending on the lock file you're using.
See https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk/aws-lambda-nodejs/lib/Dockerfile for the default image provided by @aws-cdk/aws-lambda-nodejs.
Default: - use the Docker image provided by
getDockerImage in interface BundlingOptionspublic final Map<String,String> getEnvironment()
BundlingOptionsDefault: - no environment variables are defined.
getEnvironment in interface BundlingOptionspublic final String getEsbuildVersion()
BundlingOptionsDefault: - latest v0
getEsbuildVersion in interface BundlingOptionspublic final List<String> getExternalModules()
BundlingOptionsDefault: ['aws-sdk']
getExternalModules in interface BundlingOptionspublic final String getFooter()
BundlingOptionsThis is similar to banner which inserts at the beginning instead of the end.
This is commonly used to insert comments
Default: - no comments are passed
getFooter in interface BundlingOptionspublic final Boolean getForceDockerBundling()
BundlingOptions
This is useful if your function relies on node modules
that should be installed (nodeModules) in a Lambda compatible
environment.
Default: false
getForceDockerBundling in interface BundlingOptionspublic final Boolean getKeepNames()
BundlingOptions
In JavaScript the name property on functions and classes defaults to a
nearby identifier in the source code.
However, minification renames symbols to reduce code size and bundling
sometimes need to rename symbols to avoid collisions. That changes value of
the name property for many of these cases. This is usually fine because
the name property is normally only used for debugging. However, some
frameworks rely on the name property for registration and binding purposes.
If this is the case, you can enable this option to preserve the original
name values even in minified code.
Default: false
getKeepNames in interface BundlingOptionspublic final Map<String,String> getLoader()
BundlingOptions
Configuring a loader for a given file type lets you load that file type with
an import statement or a require call.
Default: - use esbuild default loaders
Example:
// Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826 {".png";"dataurl"; }
getLoader in interface BundlingOptionshttps://esbuild.github.io/api/#loaderpublic final LogLevel getLogLevel()
BundlingOptionsDefault: LogLevel.WARNING
getLogLevel in interface BundlingOptionspublic final Boolean getMetafile()
BundlingOptionsThe metadata in this JSON file follows this schema (specified using TypeScript syntax):
// Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
{outputs: {
[path: string]: {
bytes: number
inputs: {
[path: string]: { bytesInOutput: number }
}
imports: { path: string }[]
exports: string[]
}
}
}
This data can then be analyzed by other tools. For example, bundle buddy can consume esbuild's metadata format and generates a treemap visualization of the modules in your bundle and how much space each one takes up.
Default: - false
getMetafile in interface BundlingOptionshttps://esbuild.github.io/api/#metafilepublic final Boolean getMinify()
BundlingOptionsDefault: false
getMinify in interface BundlingOptionspublic final List<String> getNodeModules()
BundlingOptionsModules are installed in a Lambda compatible environment only when bundling runs in Docker.
Default: - all modules are bundled
getNodeModules in interface BundlingOptionspublic final Boolean getSourceMap()
BundlingOptionsDefault: false
getSourceMap in interface BundlingOptionspublic final String getTarget()
BundlingOptionsDefault: - the node version of the runtime
getTarget in interface BundlingOptionshttps://esbuild.github.io/api/#targetpublic final String getTsconfig()
BundlingOptions
However, you can also configure a custom tsconfig.json file to use instead.
This is similar to entry path, you need to provide path to your custom tsconfig.json.
This can be useful if you need to do multiple builds of the same code with different settings.
Default: - automatically discovered by `esbuild`
Example:
// Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826 {"tsconfig";"path/custom.tsconfig.json"; }
getTsconfig in interface BundlingOptions@Internal public com.fasterxml.jackson.databind.JsonNode $jsii$toJson()
$jsii$toJson in interface software.amazon.jsii.JsiiSerializableCopyright © 2021. All rights reserved.