gulp-edgejs
v0.4.1
Published
Edge.js(http://edge.adonisjs.com) template engine
Downloads
67
Maintainers
Readme
gulp-edgejs
Edge.js(http://edge.adonisjs.com) template engine
Install
yarn add gulp-edgejs
Usage
Basic
const gulp = require('gulp');
const gulpEdge = require('gulp-edgejs');
gulp.task('edge', ()=>{
return gulp.src('./index.edge')
.pipe( gulpEdge() )
.pipe(gulp.dest('./build'));
});
Variable
<div>hello {{ name }}</div>
gulp.task('edge', ()=>{
return gulp.src('./index.edge')
.pipe( gulpEdge({ name: 'byungi' }) )
.pipe(gulp.dest('./build'));
});
output:
<div>hello byungi</div>
API
gulpEdge([data[, options]])
Returns gulp transformer for edge.js compilation.
data
Set the data values.
object
gulp.src('./index.edge')
.pipe( gulpEdge({ name: 'byungi' }) )
file
return gulp.src('index.edge')
.pipe( gulpEdge('./data.json') )
directory
If it is a directory
, set the data that matches the edge.js file name in the directory.
return gulp.src('edge/*.edge')
.pipe( gulpEdge('data/') )
edge/main.edge
hello {{ value }}
data/main.js
export.value = 'world'
output:
hello world
options
ext
Output extension name. Default is html
views
Directory for load other view files. (edge.js can load other view files with @layout
, @component
keyword.)
path
An alias for views
.
globals
Add global function or variable.
tags
Add custom tags.
refresh
If this value is true, import new data from the path without cache. This is useful when in watch mode. Default is false
.
License
MIT