Class BundleUtils

java.lang.Object
com.vaadin.flow.server.frontend.BundleUtils

public final class BundleUtils extends Object
  • Method Details

    • loadBundleImports

      public static Set<String> loadBundleImports()
      Loads stats.json from the classpath (from the production bundle) and returns the "bundleImports" part of it.
      Returns:
      the bundle imports as a set
    • getChunkId

      public static String getChunkId(Class<? extends Component> componentClass)
      Gets the id for a chunk defined by the given class.
      Parameters:
      componentClass - the class
      Returns:
      an identifier for the component class that does not reveal the name of the component class
    • getChunkId

      public static String getChunkId(String className)
      Gets the id for a chunk defined by the given class.
      Parameters:
      className - the name of the class
      Returns:
      an identifier for the component class that does not reveal the name of the component class
    • getChunkHash

      public static String getChunkHash(List<String> chunkLines)
      Calculates a hash for bundle JavaScript chunk containing given string lines.
      Parameters:
      chunkLines - content of the chunk, collection of string lines
      Returns:
      chunk's hash
    • isPreCompiledProductionBundle

      public static boolean isPreCompiledProductionBundle()
      Returns whether the application uses pre-compiled production bundle or a custom bundle.
      Returns:
      true in case of pre-compiled bundle, false otherwise
    • copyPackageLockFromBundle

      public static void copyPackageLockFromBundle(Options options)
      Copy package-lock.json/.yaml file from existing dev-bundle for building new bundle.
      Parameters:
      options - task options