gulp-html-static

1.0.3 • Public • Published

gulp-html-static

replace resources in html template.

Install

npm install gulp-html-static --save
git clone git@github.com: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"

License

MIT © zhe-he

Readme

Keywords

none

Package Sidebar

Install

npm i gulp-html-static

Weekly Downloads

1

Version

1.0.3

License

ISC

Last publish

Collaborators

  • zhe-he