Class Bundler.Builder

  • All Implemented Interfaces:
    software.amazon.jsii.Builder<Bundler>
    Enclosing class:
    Bundler

    @Stability(Experimental)
    public static final class Bundler.Builder
    extends Object
    implements software.amazon.jsii.Builder<Bundler>
    (experimental) A fluent builder for Bundler.
    • Method Detail

      • create

        @Stability(Experimental)
        public static Bundler.Builder create​(Project project)
        Parameters:
        project - This parameter is required.
        Returns:
        a new instance of Bundler.Builder.
      • addToPreCompile

        @Stability(Deprecated)
        @Deprecated
        public Bundler.Builder addToPreCompile​(Boolean addToPreCompile)
        Deprecated.
        Use runBundleTask instead.
        (deprecated) Install the bundle command as a pre-compile phase.

        Default: true

        Parameters:
        addToPreCompile - Install the bundle command as a pre-compile phase. This parameter is required.
        Returns:
        this
      • assetsDir

        @Stability(Experimental)
        public Bundler.Builder assetsDir​(String assetsDir)
        (experimental) Output directory for all bundles.

        Default: "assets"

        Parameters:
        assetsDir - Output directory for all bundles. This parameter is required.
        Returns:
        this
      • esbuildVersion

        @Stability(Experimental)
        public Bundler.Builder esbuildVersion​(String esbuildVersion)
        (experimental) The semantic version requirement for esbuild.

        Default: - no specific version (implies latest)

        Parameters:
        esbuildVersion - The semantic version requirement for esbuild. This parameter is required.
        Returns:
        this
      • loaders

        @Stability(Experimental)
        public Bundler.Builder loaders​(Map<String,​String> loaders)
        (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

        Parameters:
        loaders - Map of file extensions (without dot) and loaders to use for this file type. This parameter is required.
        Returns:
        this
      • runBundleTask

        @Stability(Experimental)
        public Bundler.Builder runBundleTask​(RunBundleTask runBundleTask)
        (experimental) Choose which phase (if any) to add the bundle command to.

        Note: If using addBundle() with the bundleCompiledResults, this option must be set to RunBundleTask.POST_COMPILE or RunBundleTask.MANUAL.

        Default: RunBundleTask.PRE_COMPILE

        Parameters:
        runBundleTask - Choose which phase (if any) to add the bundle command to. This parameter is required.
        Returns:
        this
        See Also:
        AddBundleOptions.bundleCompiledResults *
      • build

        @Stability(Experimental)
        public Bundler build()
        Specified by:
        build in interface software.amazon.jsii.Builder<Bundler>
        Returns:
        a newly built instance of Bundler.