Skip to content
This repository has been archived by the owner on Dec 6, 2019. It is now read-only.

Feature/minification bundling composite files #349

Conversation

TomTyack
Copy link

ClientDependency (by Shannon Deminick) is a fairly solid framework for reducing all CSS and JS file requests into a single server request. Includes versioning, minification, bundling and caching.

I can appreciate it may not be everyone's prefered way of bundling, but it could be a good option to have.

This is an integration with some code changes and the original NuGet package into the assets Foundation module, that allows a developer to bundle all the JS/CSS assets via the following tags.

Usage in Layouts
- @CompositeAssetFileService.Current.RenderStyles()
- @CompositeAssetFileService.Current.RenderScript(ScriptLocation.Body)

Includes fall back to single assets requests files if the debug="false" is set on developer machines. Composite URLs are cached on the file system in App_Data, if using the default configuration.

Configuration options can be seen in the original documentation. https://github.com/Shazwazza/ClientDependency/wiki

To use this service you will need to rename the following and run the gulp build:
/// - "App_Config/ClientDependency.config.disabled". to App_Config/ClientDependency.config
/// - "\src\Foundation\Assets\code\Web.config.transform.ClientDependency.minification.example" to Web.config.transform

Once running (not in debug mode) you will see the following asset includes in the html source.

<script src="/DependencyHandler.axd/bdc200f5bb6df7e817066f4b98499322/12/js" type="text/javascript"></script>

@TomTyack TomTyack closed this Apr 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant