gulp-inject
Advanced tools
Comparing version 2.2.0 to 3.0.0
{ | ||
"name": "gulp-inject", | ||
"version": "2.2.0", | ||
"version": "3.0.0", | ||
"description": "A javascript, stylesheet and webcomponent injection plugin for Gulp, i.e. inject file references into your index.html", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -598,3 +598,13 @@ # gulp-inject [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][depstat-image]][depstat-url] | ||
#### options.empty | ||
Type: `Boolean` | ||
Default: `false` | ||
When `true` all tags without corresponding files will be emptied. | ||
[**Warning** this has the potential issue of emptying more than expected.](https://github.com/klei/gulp-inject/issues/135) | ||
#### options.starttag | ||
@@ -601,0 +611,0 @@ |
@@ -209,17 +209,19 @@ 'use strict'; | ||
contents = contents.replace( | ||
getInjectorTagsRegExp( | ||
opt.tags.start(targetExt, '{{ANY}}', opt.starttag), | ||
opt.tags.end(targetExt, '{{ANY}}', opt.starttag) | ||
), | ||
function injector2 (match, starttag, unused, indent, content, endtag) { | ||
if (matches.indexOf(starttag) > - 1) { | ||
return match; | ||
if (opt.empty) { | ||
contents = contents.replace( | ||
getInjectorTagsRegExp( | ||
opt.tags.start(targetExt, '{{ANY}}', opt.starttag), | ||
opt.tags.end(targetExt, '{{ANY}}', opt.starttag) | ||
), | ||
function injector2 (match, starttag, unused, indent, content, endtag) { | ||
if (matches.indexOf(starttag) > - 1) { | ||
return match; | ||
} | ||
if (opt.removeTags) { | ||
return ''; | ||
} | ||
return [starttag].concat(endtag).join(indent); | ||
} | ||
if (opt.removeTags) { | ||
return ''; | ||
} | ||
return [starttag].concat(endtag).join(indent); | ||
} | ||
); | ||
); | ||
} | ||
@@ -226,0 +228,0 @@ return new Buffer(contents); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38961
512
844