Enum RunBundleTask

    • Enum Constant Detail

      • MANUAL

        @Stability(Experimental)
        public static final RunBundleTask MANUAL
        (experimental) Don't bundle automatically as part of the build.
      • PRE_COMPILE

        @Stability(Experimental)
        public static final RunBundleTask PRE_COMPILE
        (experimental) Bundle automatically before compilation.
      • POST_COMPILE

        @Stability(Experimental)
        public static final RunBundleTask POST_COMPILE
        (experimental) Bundle automatically after compilation. This is useful if you want to bundle the compiled results.

        Thus will run compilation tasks (using tsc, etc.) before running file through bundling step.

        This is only required unless you are using new experimental features that are not supported by esbuild but are supported by typescript's tsc compiler. One example of such feature is emitDecoratorMetadata.

         // In a TypeScript project with output configured
         // to go to the "lib" directory:
         const project = new TypeScriptProject({
           name: "test",
           defaultReleaseBranch: "main",
           tsconfig: {
             compilerOptions: {
               outDir: "lib",
             },
           },
           bundlerOptions: {
             // ensure we compile with `tsc` before bundling
             runBundleTask: RunBundleTask.POST_COMPILE,
           },
         });
         // Tell the bundler to bundle the compiled results (from the "lib" directory)
         project.bundler.addBundle("./lib/index.js", {
           platform: "node",
           target: "node18",
           sourcemap: false,
           format: "esm",
         });
         
    • Method Detail

      • values

        public static RunBundleTask[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (RunBundleTask c : RunBundleTask.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static RunBundleTask 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.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null