Interface IRuntimeMinifier
Used for bundling and minifying web assets at runtime
Namespace: Umbraco.Cms.Core.WebAssets
Assembly: Umbraco.Core.dll
Syntax
public interface IRuntimeMinifier
Properties
View SourceCacheBuster
Returns the cache buster value
Declaration
string CacheBuster { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
View SourceCreateCssBundle(String, BundlingOptions, String[])
Creates a css bundle
Declaration
void CreateCssBundle(string bundleName, BundlingOptions bundleOptions, params string[] filePaths)
Parameters
Type | Name | Description |
---|---|---|
System.String | bundleName | |
BundlingOptions | bundleOptions | |
System.String[] | filePaths |
Remarks
All files must be absolute paths, relative paths will throw
CreateJsBundle(String, BundlingOptions, String[])
Creates a JS bundle
Declaration
void CreateJsBundle(string bundleName, BundlingOptions bundleOptions, params string[] filePaths)
Parameters
Type | Name | Description |
---|---|---|
System.String | bundleName | |
BundlingOptions | bundleOptions | |
System.String[] | filePaths |
Remarks
All files must be absolute paths, relative paths will throw
GetCssAssetPathsAsync(String)
Returns the asset paths for the css bundle name
Declaration
Task<IEnumerable<string>> GetCssAssetPathsAsync(string bundleName)
Parameters
Type | Name | Description |
---|---|---|
System.String | bundleName |
Returns
Type | Description |
---|---|
Task<IEnumerable<System.String>> | If debug mode is enabled this will return all asset paths (not bundled), else it will return a bundle URL |
GetJsAssetPathsAsync(String)
Returns the asset paths for the JS bundle name
Declaration
Task<IEnumerable<string>> GetJsAssetPathsAsync(string bundleName)
Parameters
Type | Name | Description |
---|---|---|
System.String | bundleName |
Returns
Type | Description |
---|---|
Task<IEnumerable<System.String>> | If debug mode is enabled this will return all asset paths (not bundled), else it will return a bundle URL |
MinifyAsync(String, AssetType)
Minify the file content, of a given type
Declaration
Task<string> MinifyAsync(string fileContent, AssetType assetType)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileContent | |
AssetType | assetType |
Returns
Type | Description |
---|---|
Task<System.String> |
RenderCssHereAsync(String)
Renders the html link tag for the bundle
Declaration
Task<string> RenderCssHereAsync(string bundleName)
Parameters
Type | Name | Description |
---|---|---|
System.String | bundleName |
Returns
Type | Description |
---|---|
Task<System.String> | An html encoded string |
RenderJsHereAsync(String)
Renders the html script tag for the bundle
Declaration
Task<string> RenderJsHereAsync(string bundleName)
Parameters
Type | Name | Description |
---|---|---|
System.String | bundleName |
Returns
Type | Description |
---|---|
Task<System.String> | An html encoded string |
Reset()
Ensures that all runtime minifications are refreshed on next request. E.g. Clearing cache.
Declaration
void Reset()
Remarks
No longer necessary, invalidation occurs automatically if any of the following occur.
- Your sites assembly information version changes.
- Umbraco.Cms.Core assembly information version changes.
- RuntimeMinificationSettings Version string changes.