com.vaadin.flow.server.frontend.
Class BundleUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
copyPackageLockFromBundle
(Options options) Copy package-lock.json/.yaml file from existing dev-bundle for building new bundle.
static String
getChunkHash
(List<String> chunkLines) Calculates a hash for bundle JavaScript chunk containing given string lines.
static String
getChunkId
(Class<? extends Component> componentClass) Gets the id for a chunk defined by the given class.
static String
getChunkId
(String className) Gets the id for a chunk defined by the given class.
static boolean
Returns 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 classReturns:
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 classReturns:
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 linesReturns:
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
Copy package-lock.json/.yaml file from existing dev-bundle for building new bundle.
Parameters:
options
- task options
-