All Implemented Interfaces:
Serializable, Comparable<Charset>, java.lang.constant.Constable

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:41.146Z") @Stability(Stable) public enum Charset extends Enum<Charset>
Charset for esbuild's output.


 NodejsFunction.Builder.create(this, "my-handler")
                 .minify(true) // minify code, defaults to false
                 .sourceMap(true) // include source map, defaults to false
                 .sourceMapMode(SourceMapMode.INLINE) // defaults to SourceMapMode.DEFAULT
                 .sourcesContent(false) // do not include original source into source map, defaults to true
                 .target("es2020") // target environment for the generated JavaScript code
                 .loader(Map.of( // Use the 'dataurl' loader for '.png' files
                         ".png", "dataurl"))
                 .define(Map.of( // Replace strings during build time
                         "process.env.API_KEY", JSON.stringify("xxx-xxxx-xxx"),
                         "process.env.PRODUCTION", JSON.stringify(true),
                         "process.env.NUMBER", JSON.stringify(123)))
                 .logLevel(LogLevel.SILENT) // defaults to LogLevel.WARNING
                 .keepNames(true) // defaults to false
                 .tsconfig("custom-tsconfig.json") // use custom-tsconfig.json instead of default,
                 .metafile(true) // include meta file, defaults to false
                 .banner("/* comments */") // requires esbuild >= 0.9.0, defaults to none
                 .footer("/* comments */") // requires esbuild >= 0.9.0, defaults to none
                 .charset(Charset.UTF8) // do not escape non-ASCII characters, defaults to Charset.ASCII
                 .format(OutputFormat.ESM) // ECMAScript module output format, defaults to OutputFormat.CJS (OutputFormat.ESM requires Node.js 14.x)
                 .mainFields(List.of("module", "main")) // prefer ECMAScript versions of dependencies
                 .inject(List.of("./my-shim.js", "./other-shim.js")) // allows to automatically replace a global variable with an import from another file
                 .esbuildArgs(Map.of( // Pass additional arguments to esbuild
                         "--log-limit", "0",
                         "--splitting", true))
  • Enum Constant Details

    • ASCII

      @Stability(Stable) public static final Charset ASCII

      Any non-ASCII characters are escaped using backslash escape sequences

    • UTF8

      @Stability(Stable) public static final Charset UTF8

      Keep original characters without using escape sequences

  • Method Details

    • values

      public static Charset[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static Charset valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      name - the name of the enum constant to be returned.
      the enum constant with the specified name
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null