Clone wiki

MinCat / Configuration

Configuration

MinCat is controlled by an optional XML-based configuration file in your website root, named MinCat.config.

If this file is not found, MinCat will default to scanning your web site's project file to locate its minimization targets.

The MinCat.config file has the following structure:

<MinCat>

	<!-- One or more contexts must be specified -->
	<Context name="context name">

		<!-- One or more input patterns must be specified -->
		<Input include="*.csproj" />
		<Input exclude="**\*.min.js" />
		<Input exclude="**\_references.js" />

		<!-- One or more library patterns may be specified -->
		<Library include="Scripts\lib\**\*.js" />
	</Context>

</MinCat>

Context Reference

The <Context /> element supports these attributes:

name
Every context must have a unique name. The name is used to identify the context when a minimized file is requested during an HTTP request.
webRoot
The path to the web site's root folder. This defaults to the path of the project file. This is used during the minimization process to resolve root-relative references to other scripts.
outPattern
The pattern used to generate the path to a generated file. The default value is {ScriptDirectory}\min\{Filename}.min{Extension}. These tokens are supported:
{ScriptDirectory}The path to the un-minimized file.
{WebRoot}The path to the root of the website.
{Filename}The original filename, without extension.
{Extension}The original extension.
borders
Set this to True to generate file demarcation boundaries in the generated files. This is primary useful for debugging. The default value is False.
compressor
Controls the JavaScript compressor to use. The available options are: None, UglifyJS2.

The <Context /> element supports two child nodes: <Input /> and <Library />. Multiple Input or Library nodes may be specified under any Context. Both Input and Library support two attributes: include and exclude. These attributes accept paths to either include or exclude from minimization. These paths are relative to the project file, and may contain globs or double-globs.

If a project file is specified in a path, the project file will be scanned for all JavaScript files that it directly references.

Updated