Gulp-stylus使用jeet错误

时间:2016-08-30 06:24:17

标签: gulp stylus

我尝试用gulp在手写笔上运行jeet时遇到错误。这是我的手写笔任务:

gulp.task('stylus', function(){
    return gulp.src('src/assets/styl/*styl')
        .pipe(stylus(use:[jeet()]))
        .pipe(gulp.dest(buildPaths.css))
        .pipe(connect.reload())
});

我得到的错误:

    /var/www/html/eve/gulpfile.js:50  
            .pipe(stylus(use:[jeet()]))  
                         ^^^
    SyntaxError: missing ) after argument list
        at Object.exports.runInThisContext (vm.js:76:16)
        at Module._compile (module.js:513:28)
        at Object.Module._extensions..js (module.js:550:10)
        at Module.load (module.js:458:32)
        at tryModuleLoad (module.js:417:12)
        at Function.Module._load (module.js:409:3)
        at Module.require (module.js:468:17)
        at require (internal/module.js:20:19)  
at Liftoff.handleArguments (/home/eve/.nvm/versions/node/v6.3.1/lib/node_modules/gulp/bin/gulp.js:116:3)
    at Liftoff.<anonymous> (/home/eve/.nvm/versions/node/v6.3.1/lib/node_modules/gulp/node_modules/liftoff/index.js:198:16)

我已经尝试将jeet()从数组中删除,例如(use: jeet()),并且还检查了语法一百次,似乎没有错过。它仅在我从代码中删除use: [jeet()]时才有效。任何人都知道如何使用手写笔+ jeet与gulp?

1 个答案:

答案 0 :(得分:1)

我不确定这是问题,但我认为你需要括号:stylus({use: [jeet()]})

gulp.task('stylus', function(){
    return gulp.src('src/assets/styl/*styl')
        .pipe(stylus({use: [jeet()]}))
        .pipe(gulp.dest(buildPaths.css))
        .pipe(connect.reload())
});