gulp-inject-file
File inject plugin for gulp.
gulp-inject-file
takes a stream of source files, and replaces inject pattern with contents of the referenced file.
Installation
Install gulp-inject
as a development dependency:
npm install --save-dev gulp-inject-file
Usage
Project structure:
└── src
└── main.xml
└── subitems
└── child.xml
The target file src/main.xml
:
<!-- inject: ./subitems/child.xml-->
The child file src/subitems/child.xml
:
The gulpfile.js
:
var gulp = ;var injectfile = ; gulp;
src/main.xml
after running gulp inject
:
The injected file paths are relative to each source file's cwd
.