你能用我的gulpfile.js帮我吗?我正努力让我的玉工作

时间:2016-12-28 13:32:35

标签: javascript gulp pug

我真的不确定这有什么问题。当我告诉我julp jade命令我的终端说:

  

SyntaxError:意外的输入结束       at Object.exports.runInThisContext(vm.js:76:16)       在Module._compile(module.js:513:28)       at Object.Module._extensions..js(module.js:550:10)       在Module.load(module.js:458:32)       在tryModuleLoad(module.js:417:12)       在Function.Module._load(module.js:409:3)       在Module.require(module.js:468:17)       at require(internal / module.js:20:19)       在Liftoff.handleArguments(/usr/local/lib/node_modules/gulp/bin/gulp.js:116:3)       在Liftoff。 (/usr/local/lib/node_modules/gulp/node_modules/liftoff/index.js:198:16)

这是我的gulpfile.js

const gulp = require('gulp');
const sass = require('gulp-sass');
const browserSync = require('browser-sync').create();
const autoprefixer = require('gulp-autoprefixer');
const jade = require('gulp-jade');


// run this task by typing in gulp jade in CLI
gulp.task('jade', function() {
    return gulp.src('index.jade')
        .pipe(jade()) // pip to jade plugin
        .pipe(gulp.dest('index.html')); // tell gulp our output fo
});


gulp.task('styles', function() {
   gulp.src('stylesheets/style.sass')
       .pipe(sass())
       .pipe(autoprefixer({
            browsers: ['last 2 versions'],
            cascade: false
            }))
       .pipe(gulp.dest('css/'))
       .pipe(browserSync.stream());
});

gulp.task('browser-sync', ['styles'], function() {
    browserSync.init({
        server: {
            baseDir: "."
        },
        open: false
    });

gulp.task('default', ['browser-sync'], function() {
   gulp.watch('stylesheets/style.sass', ['styles']);
});

0 个答案:

没有答案
相关问题