Last active
July 12, 2018 05:23
-
-
Save 867/5c3c0838e7abda4ecb76e7a9b3e2800e to your computer and use it in GitHub Desktop.
公式ブログ用:gulpfile.js : gulp-beautify
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// set:beautify_option | |
const beautify_option = { | |
'indent_size': 2 | |
} | |
// task:nunjucks | |
gulp.task('nunjucks', function(){ | |
return gulp.src(paths.src.html + '**/*.njk') | |
.pipe(data(function(){ | |
return require(paths.src.json); | |
})) | |
.pipe(nunjucks({ | |
path: paths.src.template | |
})) | |
.pipe(beautify(beautify_option)) | |
.pipe(gulp.dest(paths.dest.root)) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment