Document the new Grunt disk "manifests" task
This commit is contained in:
parent
1b9350f86f
commit
6687268168
1 changed files with 14 additions and 0 deletions
14
Gruntfile.js
14
Gruntfile.js
|
|
@ -405,6 +405,20 @@ module.exports = function(grunt) {
|
||||||
],
|
],
|
||||||
options: {
|
options: {
|
||||||
process: function(content, srcPath) {
|
process: function(content, srcPath) {
|
||||||
|
/*
|
||||||
|
* This function mimics what components.xsl normally does for disk manifests referenced
|
||||||
|
* by the FDC machine component. Compare it to the following template in components.xsl:
|
||||||
|
*
|
||||||
|
* <xsl:template match="manifest[not(@ref)]" mode="component">
|
||||||
|
*
|
||||||
|
* This code is not perfect (it doesn't process "link" attributes, for example, which is why
|
||||||
|
* we've left machines that use the samples.xml disk library alone), but for machines that use
|
||||||
|
* library.xml, having them use compiled/library.xml instead speeds up loading significantly.
|
||||||
|
*
|
||||||
|
* Granted, after the first machine has fetched all the individual manifest files, your
|
||||||
|
* browser should do a reasonably good job using cached copies for all subsequent machines,
|
||||||
|
* but even then, there's still a noticeable delay.
|
||||||
|
*/
|
||||||
var contentOrig = content;
|
var contentOrig = content;
|
||||||
var reManifest = /([ \t]*)<manifest.*? ref="(.*?)".*?\/>/g, matchManifest;
|
var reManifest = /([ \t]*)<manifest.*? ref="(.*?)".*?\/>/g, matchManifest;
|
||||||
while ((matchManifest = reManifest.exec(contentOrig))) {
|
while ((matchManifest = reManifest.exec(contentOrig))) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue