lib/rewrite-middleware.js
function includeServedOnly(files) {
	files = Object.assign({}, files);
	let oldIncluded = files.included;
	files.included = files.served
		// Don’t include the files that are included in the outer context
		.filter(file => oldIncluded.indexOf(file) === -1)
		// Don’t include this (or other) contexts
		.filter(file => !isIFrameHtml(file.path))
		// Don’t include files that were never included to begin with (before the framework ran)
		// FIXME: find the most specific applicable pattern first
		.filter(file => !nonIncludedFiles.some(pattern => minimatch(file.originalPath, pattern.pattern)))
		// Don’t include the reverse context (it is included by the `transform` function below)
		.filter(file => file.originalPath !== REVERSE_CONTEXT);
	return files;
}
function includeServedOnly(files) {
	files = Object.assign({}, files);
	let oldIncluded = files.included;
	files.included = files.served
		// Don’t include the files that are included in the outer context
		.filter(file => oldIncluded.indexOf(file) === -1)
		// Don’t include this (or other) contexts
		.filter(file => !isIFrameHtml(file.path))
		// Don’t include files that were never included to begin with (before the framework ran)
		// FIXME: find the most specific applicable pattern first
		.filter(file => !nonIncludedFiles.some(pattern => minimatch(file.originalPath, pattern.pattern)))
		// Don’t include the reverse context (it is included by the `transform` function below)
		.filter(file => file.originalPath !== REVERSE_CONTEXT);
	return files;
}
function includeServedOnly ( files ) { files = Object . assign ( { } , files ) ; let oldIncluded = files . included ; files . included = files . served // Don’t include the files that are included in the outer context . filter ( file => oldIncluded . indexOf ( file ) === - 1 ) // Don’t include this (or other) contexts . filter ( file => ! isIFrameHtml ( file . path ) ) // Don’t include files that were never included to begin with (before the framework ran) // FIXME: find the most specific applicable pattern first . filter ( file => ! nonIncludedFiles . some ( pattern => minimatch ( file . originalPath , pattern . pattern ) ) ) // Don’t include the reverse context (it is included by the `transform` function below) . filter ( file => file . originalPath !== REVERSE_CONTEXT ) ; return files ; }
Reverse included and served files
Reverse included and served files