gulp.task('html', function() { console.log('压缩html...'); console.log('更新版本号...'); return gulp.src('view/development/*/*.html') .pipe(cdn({suffix: '.min',root: 'http://7u2sls.com1.z0.glb.clouddn.com'})) .pipe(minifyejs()) .pipe(gulp.dest('view/production')) });
gulp.task('ejs',function(){ return gulp.src('src/ejs/index.ejs') .pipe(changed(dest,{hasChanged: changed.compareSha1Digest})) .pipe(data(getJsonData)) .pipe(ejs()) .pipe(rename(function(path){ path.extname='.html' })) .pipe(minifyejs()) .pipe(gulp.dest(dest)) })
gulp.task('minify-html', function() { return gulp.src('./views/**/*.html') .pipe(minifyejs()) .pipe(gulp.dest('./mini/html')); });
gulp.task('partials', function () { return gulp.src(paths.src.partials) .pipe(plumber()) .pipe(ejsmin()) .pipe(gulp.dest(paths.dist.partials)); });
gulp.task('views', function() { return gulp.src(paths.src.ejs) .pipe(plumber()) .pipe(ejsmin()) .pipe(gulp.dest(paths.dist.ejs)); });