gulp-preprocess-file
A Gulp plugin for Preprocess files based off environment configuration. Based on Preprocess package
Usage
Install
Use npm.
$ npm install --save-dev gulp-preprocess-file
Examples
Gulpfile
var preprocess = require('gulp-preprocess-file');
gulp.task('html', function() {
gulp.src('./src/*.html')
.pipe(preprocess({
context: {
NODE_ENV: 'production',
title: 'Hello gulp'
}
}))
.pipe(gulp.dest('./dist/'))
});
html file
<body>
<h1></h1>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.2.1/dist/jquery.min.js"></script>
<script>
var title = '' || 'Default'
</script>
</body>
more: preprocess
License
gulp-preprocess-file
Based on Preprocess package
MIT © Mervin