Server Side Includes parser plugin for gulp
npm install gulp-ssi> Server Side Includes parser plugin for gulp
Works with both include types
``html`
`html`
And now also correctly interprets directives from the root of a site
`html`
First, install gulp-ssi as a development dependency:
`shell`
npm install --save-dev gulp-ssi
Then, add it to your gulpfile.js:
`javascript
var ssi = require("gulp-ssi");
gulp.src("./src/*.ext")
.pipe(ssi())
.pipe(gulp.dest("./dist"));
`
javascript
var ssi = require("gulp-ssi");gulp.src("./src/*.ext")
.pipe(ssi({root:'/some/path'}))
.pipe(gulp.dest("./dist"));
`
$3
Type: String
Default: File directorySet the location where the linked files are hosted. I've preserved this feature to prevent breaking existing clients. It works fine, but it makes assumptions that all relative links eventually resolve to the root of the root directory. So...
With a root of /myroot and an include that looks like
` `` ssi will look for a file at this path: [npm-url]: https://npmjs.org/package/gulp-ssi
[npm-image]: https://badge.fury.io/js/gulp-ssi.png
[travis-url]: http://travis-ci.org/etylsarin/gulp-ssi
[travis-image]: https://secure.travis-ci.org/etylsarin/gulp-ssi.png?branch=master