gulp-inject = function (sources, opt) { if (!sources) { throw error('Missing sources stream!'); } if (!opt) { opt = {}; } if (opt.sort) { throw error('sort option is deprecated! Use `sort-stream` module instead!'); } if (opt.templateString) { throw error('`templateString` option is deprecated! Create a virtual `vinyl` file instead!'); } if (opt.transform && typeof opt.transform !== 'function') { throw error('transform option must be a function'); } // Notify people of common mistakes... if (typeof opt.read !== 'undefined') { throw error('There is no `read` option. Did you mean to provide it for `gulp.src` perhaps?'); } // Defaults: opt.quiet = bool(opt, 'quiet', false); opt.relative = bool(opt, 'relative', false); opt.addRootSlash = bool(opt, 'addRootSlash', !opt.relative); opt.transform = defaults(opt, 'transform', transform); opt.tags = tags(); opt.name = defaults(opt, 'name', DEFAULT_NAME_FOR_TAGS); transform.selfClosingTag = bool(opt, 'selfClosingTag', false); // Is the first parameter a Vinyl File Stream: if (typeof sources.on === 'function' && typeof sources.pipe === 'function') { return handleVinylStream(sources, opt); } throw error('passing target file as a string is deprecated! Pass a vinyl file stream (i.e. use `gulp.src`)!'); }
n/a
transform = function (filepath, i, length, sourceFile, targetFile) { var type; if (targetFile && targetFile.path) { var ext = extname(targetFile.path); type = typeFromExt(ext); } if (!isTargetType(type)) { type = DEFAULT_TARGET; } var func = transform[type]; if (func) { return func.apply(transform, arguments); } }
n/a
transform.haml = function (filepath) { var ext = extname(filepath); var type = typeFromExt(ext); var func = transform[targetType][type]; if (func) { return func.apply(transform[targetType], arguments); } }
n/a
transform.html = function (filepath) { var ext = extname(filepath); var type = typeFromExt(ext); var func = transform[targetType][type]; if (func) { return func.apply(transform[targetType], arguments); } }
n/a
transform.jade = function (filepath) { var ext = extname(filepath); var type = typeFromExt(ext); var func = transform[targetType][type]; if (func) { return func.apply(transform[targetType], arguments); } }
n/a
transform.jsx = function (filepath) { var ext = extname(filepath); var type = typeFromExt(ext); var func = transform[targetType][type]; if (func) { return func.apply(transform[targetType], arguments); } }
n/a
transform.less = function (filepath) { var ext = extname(filepath); var type = typeFromExt(ext); var func = transform[targetType][type]; if (func) { return func.apply(transform[targetType], arguments); } }
n/a
transform.pug = function (filepath) { var ext = extname(filepath); var type = typeFromExt(ext); var func = transform[targetType][type]; if (func) { return func.apply(transform[targetType], arguments); } }
n/a
transform.sass = function (filepath) { var ext = extname(filepath); var type = typeFromExt(ext); var func = transform[targetType][type]; if (func) { return func.apply(transform[targetType], arguments); } }
n/a
transform.scss = function (filepath) { var ext = extname(filepath); var type = typeFromExt(ext); var func = transform[targetType][type]; if (func) { return func.apply(transform[targetType], arguments); } }
n/a
transform.slim = function (filepath) { var ext = extname(filepath); var type = typeFromExt(ext); var func = transform[targetType][type]; if (func) { return func.apply(transform[targetType], arguments); } }
n/a
transform.slm = function (filepath) { var ext = extname(filepath); var type = typeFromExt(ext); var func = transform[targetType][type]; if (func) { return func.apply(transform[targetType], arguments); } }
n/a
transform = function (filepath, i, length, sourceFile, targetFile) { var type; if (targetFile && targetFile.path) { var ext = extname(targetFile.path); type = typeFromExt(ext); } if (!isTargetType(type)) { type = DEFAULT_TARGET; } var func = transform[type]; if (func) { return func.apply(transform, arguments); } }
n/a
haml = function (filepath) { var ext = extname(filepath); var type = typeFromExt(ext); var func = transform[targetType][type]; if (func) { return func.apply(transform[targetType], arguments); } }
n/a
html = function (filepath) { var ext = extname(filepath); var type = typeFromExt(ext); var func = transform[targetType][type]; if (func) { return func.apply(transform[targetType], arguments); } }
n/a
jade = function (filepath) { var ext = extname(filepath); var type = typeFromExt(ext); var func = transform[targetType][type]; if (func) { return func.apply(transform[targetType], arguments); } }
n/a
jsx = function (filepath) { var ext = extname(filepath); var type = typeFromExt(ext); var func = transform[targetType][type]; if (func) { return func.apply(transform[targetType], arguments); } }
n/a
less = function (filepath) { var ext = extname(filepath); var type = typeFromExt(ext); var func = transform[targetType][type]; if (func) { return func.apply(transform[targetType], arguments); } }
n/a
pug = function (filepath) { var ext = extname(filepath); var type = typeFromExt(ext); var func = transform[targetType][type]; if (func) { return func.apply(transform[targetType], arguments); } }
n/a
sass = function (filepath) { var ext = extname(filepath); var type = typeFromExt(ext); var func = transform[targetType][type]; if (func) { return func.apply(transform[targetType], arguments); } }
n/a
scss = function (filepath) { var ext = extname(filepath); var type = typeFromExt(ext); var func = transform[targetType][type]; if (func) { return func.apply(transform[targetType], arguments); } }
n/a
slim = function (filepath) { var ext = extname(filepath); var type = typeFromExt(ext); var func = transform[targetType][type]; if (func) { return func.apply(transform[targetType], arguments); } }
n/a
slm = function (filepath) { var ext = extname(filepath); var type = typeFromExt(ext); var func = transform[targetType][type]; if (func) { return func.apply(transform[targetType], arguments); } }
n/a
haml = function (filepath) { var ext = extname(filepath); var type = typeFromExt(ext); var func = transform[targetType][type]; if (func) { return func.apply(transform[targetType], arguments); } }
n/a
coffee = function (filepath) { return '%script{type:"text/coffeescript", src:"' + filepath + '"}'; }
n/a
css = function (filepath) { return '%link{rel:"stylesheet", href:"' + filepath + '"}'; }
n/a
html = function (filepath) { return '%link{rel:"import", href:"' + filepath + '"}'; }
n/a
image = function (filepath) { return '%img{src:"' + filepath + '"}'; }
n/a
js = function (filepath) { return '%script{src:"' + filepath + '"}'; }
n/a
html = function (filepath) { return '<link rel="import" href="' + filepath + '"' + end(); }
n/a
coffee = function (filepath) { return '<script type="text/coffeescript" src="' + filepath + '"></script>'; }
n/a
css = function (filepath) { return '<link rel="stylesheet" href="' + filepath + '"' + end(); }
n/a
image = function (filepath) { return '<img src="' + filepath + '"' + end(); }
n/a
js = function (filepath) { return '<script src="' + filepath + '"></script>'; }
n/a
jsx = function (filepath) { return '<script type="text/jsx" src="' + filepath + '"></script>'; }
n/a
map = function (filepath) { return '<script src="' + filepath + '"></script>'; }
n/a
jade = function (filepath) { return 'include ' + filepath; }
n/a
coffee = function (filepath) { return 'script(type="text/coffeescript", src="' + filepath + '")'; }
n/a
css = function (filepath) { return 'link(rel="stylesheet", href="' + filepath + '")'; }
n/a
html = function (filepath) { return 'link(rel="import", href="' + filepath + '")'; }
n/a
image = function (filepath) { return 'img(src="' + filepath + '")'; }
n/a
js = function (filepath) { return 'script(src="' + filepath + '")'; }
n/a
jsx = function (filepath) { return 'script(type="text/jsx", src="' + filepath + '")'; }
n/a
jsx = function () { var originalOption = transform.selfClosingTag; transform.selfClosingTag = true; var result = transform.html[type].apply(transform.html, arguments); transform.selfClosingTag = originalOption; return result; }
n/a
coffee = function () { var originalOption = transform.selfClosingTag; transform.selfClosingTag = true; var result = transform.html[type].apply(transform.html, arguments); transform.selfClosingTag = originalOption; return result; }
n/a
css = function () { var originalOption = transform.selfClosingTag; transform.selfClosingTag = true; var result = transform.html[type].apply(transform.html, arguments); transform.selfClosingTag = originalOption; return result; }
n/a
html = function () { var originalOption = transform.selfClosingTag; transform.selfClosingTag = true; var result = transform.html[type].apply(transform.html, arguments); transform.selfClosingTag = originalOption; return result; }
n/a
image = function () { var originalOption = transform.selfClosingTag; transform.selfClosingTag = true; var result = transform.html[type].apply(transform.html, arguments); transform.selfClosingTag = originalOption; return result; }
n/a
js = function () { var originalOption = transform.selfClosingTag; transform.selfClosingTag = true; var result = transform.html[type].apply(transform.html, arguments); transform.selfClosingTag = originalOption; return result; }
n/a
map = function () { var originalOption = transform.selfClosingTag; transform.selfClosingTag = true; var result = transform.html[type].apply(transform.html, arguments); transform.selfClosingTag = originalOption; return result; }
n/a
less = function (filepath) { return '@import "' + filepath + '";'; }
n/a
css = function (filepath) { return '@import "' + filepath + '";'; }
n/a
pug = function (filepath) { return 'include ' + filepath; }
n/a
coffee = function (filepath) { return 'script(type="text/coffeescript", src="' + filepath + '")'; }
n/a
css = function (filepath) { return 'link(rel="stylesheet", href="' + filepath + '")'; }
n/a
html = function (filepath) { return 'link(rel="import", href="' + filepath + '")'; }
n/a
image = function (filepath) { return 'img(src="' + filepath + '")'; }
n/a
js = function (filepath) { return 'script(src="' + filepath + '")'; }
n/a
jsx = function (filepath) { return 'script(type="text/jsx", src="' + filepath + '")'; }
n/a
sass = function (filepath) { return '@import "' + filepath + '"'; }
n/a
css = function (filepath) { return '@import "' + filepath + '"'; }
n/a
scss = function (filepath) { return '@import "' + filepath + '"'; }
n/a
scss = function (filepath) { return '@import "' + filepath + '";'; }
n/a
css = function (filepath) { return '@import "' + filepath + '";'; }
n/a
sass = function (filepath) { return '@import "' + filepath + '";'; }
n/a
slim = function (filepath) { var ext = extname(filepath); var type = typeFromExt(ext); var func = transform[targetType][type]; if (func) { return func.apply(transform[targetType], arguments); } }
n/a
coffee = function (filepath) { return 'script type="text/coffeescript" src="' + filepath + '"'; }
n/a
css = function (filepath) { return 'link rel="stylesheet" href="' + filepath + '"'; }
n/a
html = function (filepath) { return 'link rel="import" href="' + filepath + '"'; }
n/a
image = function (filepath) { return 'img src="' + filepath + '"'; }
n/a
js = function (filepath) { return 'script src="' + filepath + '"'; }
n/a
slm = function (filepath) { var ext = extname(filepath); var type = typeFromExt(ext); var func = transform[targetType][type]; if (func) { return func.apply(transform[targetType], arguments); } }
n/a
coffee = function (filepath) { return 'script type="text/coffeescript" src="' + filepath + '"'; }
n/a
css = function (filepath) { return 'link rel="stylesheet" href="' + filepath + '"'; }
n/a
html = function (filepath) { return 'link rel="import" href="' + filepath + '"'; }
n/a
image = function (filepath) { return 'img src="' + filepath + '"'; }
n/a
js = function (filepath) { return 'script src="' + filepath + '"'; }
n/a