Getting: SyntaxError: missing ) after argument list but can't find out whats wrong with hulpfile.js

前端 未结 2 2057
萌比男神i
萌比男神i 2021-01-26 01:00

Hi I\'m getting an error starting \'gulp default\' with the following gulp file. I cannot figure out whats wrong with the file.

var gulp = require(\'gulp\');
var         


        
2条回答
  •  别那么骄傲
    2021-01-26 01:18

    See Gulp Sass with errLogToConsole: true still stopping my other watch tasks and Gulp-generated source maps don't work in Chrome.

    Don't use errLogToConsole it doesn't appear to be supported anymore.

    .pipe(sass(errLogToConsole: true, outputStyle: 'compressed'))
    

    Change that to

    .pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError))

    as in gulp-sass options. Your earlier error was probably due to not including your options in {} braces (it is an object).

    [EDIT] :

    And your other error is the same

    .pipe(autoprefixer(browsers: ['last 2 versions', '> 5%', 'Firefox ESR']))
    

    should be

    .pipe(autoprefixer( { browsers: ['last 2 versions', '> 5%', 'Firefox ESR'] } ))
    

    Note the curly braces. Usually the options to gulp plugins are objects so they need to be wrapped in braces {}.

提交回复
热议问题