Class AddBundleOptions.Jsii$Proxy
- java.lang.Object
-
- software.amazon.jsii.JsiiObject
-
- io.github.cdklabs.projen.javascript.AddBundleOptions.Jsii$Proxy
-
- All Implemented Interfaces:
AddBundleOptions,BundlingOptions,software.amazon.jsii.JsiiSerializable
- Enclosing interface:
- AddBundleOptions
@Stability(Experimental) @Internal public static final class AddBundleOptions.Jsii$Proxy extends software.amazon.jsii.JsiiObject implements AddBundleOptions
An implementation forAddBundleOptions
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
-
Nested classes/interfaces inherited from interface io.github.cdklabs.projen.javascript.AddBundleOptions
AddBundleOptions.Builder, AddBundleOptions.Jsii$Proxy
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedJsii$Proxy(AddBundleOptions.Builder builder)Constructor that initializes the object based on literal property values passed by theAddBundleOptions.Builder.protectedJsii$Proxy(software.amazon.jsii.JsiiObjectRef objRef)Constructor that initializes the object based on values retrieved from the JsiiObject.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.fasterxml.jackson.databind.JsonNode$jsii$toJson()booleanequals(Object o)StringgetBanner()(experimental) Use this to insert an arbitrary string at the beginning of generated JavaScript files.CharsetgetCharset()(experimental) The charset to use for esbuild's output.Map<String,String>getDefine()(experimental) Replace global identifiers with constant expressions.Map<String,Object>getEsbuildArgs()(experimental) Build arguments to pass into esbuild.BooleangetExecutable()(experimental) Mark the output file as executable.List<String>getExternals()(experimental) You can mark a file or a package as external to exclude it from your build.StringgetFooter()(experimental) Use this to insert an arbitrary string at the end of generated JavaScript files.StringgetFormat()(experimental) Output format for the generated JavaScript files.List<String>getInject()(experimental) This option allows you to automatically replace a global variable with an import from another file.BooleangetKeepNames()(experimental) Whether to preserve the originalnamevalues even in minified code.Map<String,String>getLoaders()(experimental) Map of file extensions (without dot) and loaders to use for this file type.BundleLogLevelgetLogLevel()(experimental) Log level for esbuild.List<String>getMainFields()(experimental) How to determine the entry point for modules.BooleangetMetafile()(experimental) This option tells esbuild to write out a JSON file relative to output directory with metadata about the build.BooleangetMinify()(experimental) Whether to minify files when bundling.StringgetOutfile()(experimental) Bundler output path relative to the asset's output directory.StringgetPlatform()(experimental) esbuild platform.BooleangetSourcemap()(experimental) Include a source map in the bundle.SourceMapModegetSourceMapMode()(experimental) Source map mode to be used when bundling.BooleangetSourcesContent()(experimental) Whether to include original source code in source maps when bundling.StringgetTarget()(experimental) esbuild target.StringgetTsconfigPath()(experimental) The path of the tsconfig.json file to use for bundling.BooleangetWatchTask()(experimental) In addition to thebundle:xyztask, createsbundle:xyz:watchtask which will invoke the same esbuild command with the--watchflag.inthashCode()
-
-
-
Constructor Detail
-
Jsii$Proxy
protected Jsii$Proxy(software.amazon.jsii.JsiiObjectRef objRef)
Constructor that initializes the object based on values retrieved from the JsiiObject.- Parameters:
objRef- Reference to the JSII managed object.
-
Jsii$Proxy
protected Jsii$Proxy(AddBundleOptions.Builder builder)
Constructor that initializes the object based on literal property values passed by theAddBundleOptions.Builder.
-
-
Method Detail
-
getPlatform
public final String getPlatform()
Description copied from interface:AddBundleOptions(experimental) esbuild platform.Example:
"node"
- Specified by:
getPlatformin interfaceAddBundleOptions
-
getTarget
public final String getTarget()
Description copied from interface:AddBundleOptions(experimental) esbuild target.Example:
"node12"
- Specified by:
getTargetin interfaceAddBundleOptions
-
getBanner
public final String getBanner()
Description copied from interface:AddBundleOptions(experimental) Use this to insert an arbitrary string at the beginning of generated JavaScript files.This 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
- Specified by:
getBannerin interfaceAddBundleOptions
-
getCharset
public final Charset getCharset()
Description copied from interface:AddBundleOptions(experimental) The charset to use for esbuild's output.By default esbuild's output is ASCII-only. Any non-ASCII characters are escaped using backslash escape sequences. Using escape sequences makes the generated output slightly bigger, and also makes it harder to read. If you would like for esbuild to print the original characters without using escape sequences, use
Charset.UTF8.Default: Charset.ASCII
- Specified by:
getCharsetin interfaceAddBundleOptions- See Also:
- https://esbuild.github.io/api/#charset
-
getDefine
public final Map<String,String> getDefine()
Description copied from interface:AddBundleOptions(experimental) Replace global identifiers with constant expressions.For example,
{ 'process.env.DEBUG': 'true' }.Another example,
{ 'process.env.API_KEY': JSON.stringify('xxx-xxxx-xxx') }.Default: - no replacements are made
- Specified by:
getDefinein interfaceAddBundleOptions
-
getEsbuildArgs
public final Map<String,Object> getEsbuildArgs()
Description copied from interface:AddBundleOptions(experimental) Build arguments to pass into esbuild.For example, to add the --log-limit flag:
project.bundler.addBundle("./src/hello.ts", { platform: "node", target: "node18", sourcemap: true, format: "esm", esbuildArgs: { "--log-limit": "0", }, });Default: - no additional esbuild arguments are passed
- Specified by:
getEsbuildArgsin interfaceAddBundleOptions
-
getExecutable
public final Boolean getExecutable()
Description copied from interface:AddBundleOptions(experimental) Mark the output file as executable.Default: false
- Specified by:
getExecutablein interfaceAddBundleOptions
-
getFooter
public final String getFooter()
Description copied from interface:AddBundleOptions(experimental) Use this to insert an arbitrary string at the end of generated JavaScript files.This 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
- Specified by:
getFooterin interfaceAddBundleOptions
-
getFormat
public final String getFormat()
Description copied from interface:AddBundleOptions(experimental) Output format for the generated JavaScript files.There are currently three possible values that can be configured:
"iife","cjs", and"esm".If not set (
undefined), esbuild picks an output format for you based onplatform:"cjs"ifplatformis"node""iife"ifplatformis"browser""esm"ifplatformis"neutral"
Note: If making a bundle to run under node with ESM, set
formatto"esm"instead of settingplatformto"neutral".Default: undefined
- Specified by:
getFormatin interfaceAddBundleOptions- See Also:
- https://esbuild.github.io/api/#format
-
getInject
public final List<String> getInject()
Description copied from interface:AddBundleOptions(experimental) This option allows you to automatically replace a global variable with an import from another file.Default: - no code is injected
- Specified by:
getInjectin interfaceAddBundleOptions- See Also:
- https://esbuild.github.io/api/#inject
-
getKeepNames
public final Boolean getKeepNames()
Description copied from interface:AddBundleOptions(experimental) Whether to preserve the originalnamevalues even in minified code.In JavaScript the
nameproperty 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
nameproperty for many of these cases. This is usually fine because thenameproperty is normally only used for debugging. However, some frameworks rely on thenameproperty for registration and binding purposes. If this is the case, you can enable this option to preserve the originalnamevalues even in minified code.Default: false
- Specified by:
getKeepNamesin interfaceAddBundleOptions
-
getLoaders
public final Map<String,String> getLoaders()
Description copied from interface:AddBundleOptions(experimental) Map of file extensions (without dot) and loaders to use for this file type.Loaders are appended to the esbuild command by
--loader:.extension=loader- Specified by:
getLoadersin interfaceAddBundleOptions
-
getLogLevel
public final BundleLogLevel getLogLevel()
Description copied from interface:AddBundleOptions(experimental) Log level for esbuild.This is also propagated to the package manager and applies to its specific install command.
Default: LogLevel.WARNING
- Specified by:
getLogLevelin interfaceAddBundleOptions
-
getMainFields
public final List<String> getMainFields()
Description copied from interface:AddBundleOptions(experimental) How to determine the entry point for modules.Try ['module', 'main'] to default to ES module versions.
Default: []
- Specified by:
getMainFieldsin interfaceAddBundleOptions
-
getMetafile
public final Boolean getMetafile()
Description copied from interface:AddBundleOptions(experimental) This option tells esbuild to write out a JSON file relative to output directory with metadata about the build.The metadata in this JSON file follows this schema (specified using TypeScript syntax):
{ 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
- Specified by:
getMetafilein interfaceAddBundleOptions- See Also:
- https://esbuild.github.io/api/#metafile
-
getMinify
public final Boolean getMinify()
Description copied from interface:AddBundleOptions(experimental) Whether to minify files when bundling.Default: false
- Specified by:
getMinifyin interfaceAddBundleOptions
-
getOutfile
public final String getOutfile()
Description copied from interface:AddBundleOptions(experimental) Bundler output path relative to the asset's output directory.Default: "index.js"
- Specified by:
getOutfilein interfaceAddBundleOptions
-
getSourceMapMode
public final SourceMapMode getSourceMapMode()
Description copied from interface:AddBundleOptions(experimental) Source map mode to be used when bundling.Default: SourceMapMode.DEFAULT
- Specified by:
getSourceMapModein interfaceAddBundleOptions- See Also:
- https://esbuild.github.io/api/#sourcemap
-
getSourcesContent
public final Boolean getSourcesContent()
Description copied from interface:AddBundleOptions(experimental) Whether to include original source code in source maps when bundling.Default: true
- Specified by:
getSourcesContentin interfaceAddBundleOptions- See Also:
- https://esbuild.github.io/api/#sources-content
-
getTsconfigPath
public final String getTsconfigPath()
Description copied from interface:AddBundleOptions(experimental) The path of the tsconfig.json file to use for bundling.Default: "tsconfig.json"
- Specified by:
getTsconfigPathin interfaceAddBundleOptions
-
getExternals
public final List<String> getExternals()
Description copied from interface:BundlingOptions(experimental) You can mark a file or a package as external to exclude it from your build.Instead of being bundled, the import will be preserved (using require for the iife and cjs formats and using import for the esm format) and will be evaluated at run time instead.
This has several uses. First of all, it can be used to trim unnecessary code from your bundle for a code path that you know will never be executed. For example, a package may contain code that only runs in node but you will only be using that package in the browser. It can also be used to import code in node at run time from a package that cannot be bundled. For example, the fsevents package contains a native extension, which esbuild doesn't support.
Default: []
- Specified by:
getExternalsin interfaceBundlingOptions
-
getSourcemap
public final Boolean getSourcemap()
Description copied from interface:BundlingOptions(experimental) Include a source map in the bundle.Default: false
- Specified by:
getSourcemapin interfaceBundlingOptions
-
getWatchTask
public final Boolean getWatchTask()
Description copied from interface:BundlingOptions(experimental) In addition to thebundle:xyztask, createsbundle:xyz:watchtask which will invoke the same esbuild command with the--watchflag.This can be used to continusouly watch for changes.
Default: true
- Specified by:
getWatchTaskin interfaceBundlingOptions
-
$jsii$toJson
@Internal public com.fasterxml.jackson.databind.JsonNode $jsii$toJson()
- Specified by:
$jsii$toJsonin interfacesoftware.amazon.jsii.JsiiSerializable
-
-