gulp-url-replace
v1.0.2
Published
a gulp plugin to replace the resource url,gulpplugin
Downloads
111
Readme
gulp-url-replace
gulp构建中用来替换 js,css,img等资源的路径,通常用于从开发文件夹搬运到生产文件夹
安装
npm install gulp-url-replace --save-dev
使用
var gulp = require('gulp');
var replace = require('gulp-url-replace')
gulp.task('move', function(){
gulp.src('./*.html')
.pipe(replace({
'lib/': '<%= stHost %>/node/public/lib/',
'img/':'<%= stHost %>/node/public/img/',
'css/': '<%= stHost %>/node/public/css/',
'js/': '<%= stHost %>/node/public/js/',
}))
.pipe(gulp.dest("../production/views/"))
})
API
gulp-url-replace can be called with a object