new ScriptStyleTagHasher(compiler, options)
- Source:
Parameters:
Name | Type | Description |
---|---|---|
compiler |
Compiler
|
an instance of a amy compiler, i.e. RuntimeCompiler |
options |
Object
|
options containing the hash function to be used, i.e., sha256. Default is sha256 |
Methods
computeHashValues(the) → {Object}
Finds all script and style nodes in the given parent node and computes hash value using the text values.
Please note: The given node will be compiled fully. This requires a context object, so that placeholders and, i.e., foreach commands can be executed
Parameters:
Name | Type | Description |
---|---|---|
the |
String
|
file to compile and compute hash values from. Must be in configured base folder of compiler. |
Returns:
- Type:
-
Object
an object containg hash values for all script and style tags, i.e., {scripts: [sha256-OOvkOPunan07ERTT+O32q2TI4K2jvUvmUe3b4RvT8cI=], styles: [sha256-OOvkOPunan07ERTT+O32q2TI4K2jvUvmUe3b4RvT8cI=]}