Package com.vaadin.flow.server.frontend
Class BundleUtils
java.lang.Object
com.vaadin.flow.server.frontend.BundleUtils
Utility class for bundle operations.
For internal use only. May be renamed or removed in a future release.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcopyPackageLockFromBundle(Options options) Copy package-lock.json/.yaml file from existing dev-bundle for building new bundle.static StringgetChunkHash(List<String> chunkLines) Calculates a hash for bundle JavaScript chunk containing given string lines.static StringgetChunkId(Class<? extends Component> componentClass) Gets the id for a chunk defined by the given class.static StringgetChunkId(String className) Gets the id for a chunk defined by the given class.static booleanReturns whether the application uses pre-compiled production bundle or a custom bundle.Loads stats.json from the classpath (from the production bundle) and returns the "bundleImports" part of it.
-
Method Details
-
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
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
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
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:
truein case of pre-compiled bundle,falseotherwise
-
copyPackageLockFromBundle
Copy package-lock.json/.yaml file from existing dev-bundle for building new bundle.- Parameters:
options- task options
-