Skip to content

Instantly share code, notes, and snippets.

@iktakahiro
Last active September 25, 2017 09:28
Show Gist options
  • Save iktakahiro/7fa93080932eed44c3c2 to your computer and use it in GitHub Desktop.
Save iktakahiro/7fa93080932eed44c3c2 to your computer and use it in GitHub Desktop.
gulp-ejs 2.0.0 で .html ファイルを出力する場合拡張子の指定が必須に ref: http://qiita.com/iktakahiro/items/5a6228a880a0a1321a39
import ejs from 'gulp-ejs';
gulp.task('ejs', () => {
var json = JSON.parse(fs.readFileSync("./src/html/_layout/var.json"));
gulp.src(['./src/html/_page/**/*.ejs'])
.pipe(ejs(json, {"ext": ".html"})) // "ext" の値を指定
.pipe(gulp.dest('./dist/html/'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment