Gulp在本地但不在服务器

时间:2016-12-20 08:59:23

标签: javascript gulp gulp-watch gulp-concat gulp-uglify

我在代码下面运行以生成' .min'本地文件及其工作正常但它在服务器上不起作用。代码中有什么问题吗?

var fs = require('fs'),
    es = require('event-stream'),
    gulp = require('gulp'),
    compass = require('gulp-compass'),
    concat = require('gulp-concat'),
    jshint = require('gulp-jshint'),
    scsslint = require('gulp-scsslint'),
    sourcemaps = require('gulp-sourcemaps'),
    uglify = require('gulp-uglify');
    minifyCSS = require('gulp-minify-css');

JavaScript任务:

gulp.task('javascript', function(){
   gulp.src('js/animation.js')
   .pipe(concat('js/animation.min.js'))
   .pipe(uglify())
   .pipe(gulp.dest(''));
});

gulp.task('style', function(){
   gulp.src(['css/transition.css'])
   .pipe(concat('css/transition.min.css'))
   .pipe(minifyCSS())
   .pipe(gulp.dest(''));
});

观看文件:

gulp.task('watch', ['build'], function() {
    gulp.watch(['css/transition.css'], ['style']);
    gulp.watch(['js/animation.js'], ['javascript']);
});

任务套装:

gulp.task('build', [
    'css','js'
]);

gulp.task('default', ['watch','build']);

0 个答案:

没有答案