gulp-html-static
v1.0.3
Published
change url or replace url or add prefix url
Downloads
37
Readme
gulp-html-static
replace resources in html template.
Install
npm install gulp-html-static --save
git clone [email protected]:zhe-he/gulp-html-static.git
demo
npm run build
gulpfile
var gulp = require('gulp');
var static = require('gulp-html-static');
gulp.task('static', function () {
return gulp.src('templates/**/*.html')
.pipe( static({
'/src/js/': 'http://static.xxx.com/src/js/',
'/link/img/': 'http://static.xxx.com/img/',
'/${': 'http://static.xxx.com/${',
'other': function (str,index){
return "/change/"+str;
}
}) )
.pipe( gulp.dest('dist') );
});
Options
"/src/js/" => "http://static.xxx.com/src/js/"
"/link/img/" => "http://static.xxx.com/img/"
"/${" => "http://static.xxx.com/${"
"other" => "return string"