Class Bundler

  • All Implemented Interfaces:
    software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

    @Generated(value="jsii-pacmak/1.96.0 (build 921e240)",
               date="2024-03-28T21:16:43.160Z")
    @Stability(Experimental)
    public class Bundler
    extends Component
    (experimental) Adds support for bundling JavaScript applications and dependencies into a single file.

    In the future, this will also supports bundling websites.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Bundler.Builder
      (experimental) A fluent builder for Bundler.
      • Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

        software.amazon.jsii.JsiiObject.InitializationMode
      • Nested classes/interfaces inherited from interface software.constructs.IConstruct

        software.constructs.IConstruct.Jsii$Default, software.constructs.IConstruct.Jsii$Proxy
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
        Bundler​(Project project)
      (experimental) Creates a Bundler.
        Bundler​(Project project, BundlerOptions options)
      (experimental) Creates a Bundler.
      protected Bundler​(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)  
      protected Bundler​(software.amazon.jsii.JsiiObjectRef objRef)  
    • Constructor Detail

      • Bundler

        protected Bundler​(software.amazon.jsii.JsiiObjectRef objRef)
      • Bundler

        protected Bundler​(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
      • Bundler

        @Stability(Experimental)
        public Bundler​(@NotNull
                       Project project,
                       @Nullable
                       BundlerOptions options)
        (experimental) Creates a Bundler.

        Parameters:
        project - This parameter is required.
        options -
      • Bundler

        @Stability(Experimental)
        public Bundler​(@NotNull
                       Project project)
        (experimental) Creates a Bundler.

        Parameters:
        project - This parameter is required.
    • Method Detail

      • of

        @Stability(Experimental)
        @Nullable
        public static Bundler of​(@NotNull
                                 Project project)
        (experimental) Returns the Bundler instance associated with a project or undefined if there is no Bundler.

        Parameters:
        project - The project. This parameter is required.
        Returns:
        A bundler
      • addBundle

        @Stability(Experimental)
        @NotNull
        public Bundle addBundle​(@NotNull
                                String entrypoint,
                                @NotNull
                                AddBundleOptions options)
        (experimental) Adds a task to the project which bundles a specific entrypoint and all of its dependencies into a single javascript output file.

        Parameters:
        entrypoint - The relative path of the artifact within the project. This parameter is required.
        options - Bundling options. This parameter is required.
      • getBundledir

        @Stability(Experimental)
        @NotNull
        public String getBundledir()
        (experimental) Root bundle directory.
      • getBundleTask

        @Stability(Experimental)
        @NotNull
        public Task getBundleTask()
        (experimental) Gets or creates the singleton "bundle" task of the project.

        If the project doesn't have a "bundle" task, it will be created and spawned during the pre-compile phase.

      • getEsbuildVersion

        @Stability(Experimental)
        @Nullable
        public String getEsbuildVersion()
        (experimental) The semantic version requirement for esbuild (if defined).