ApathyBear
ApathyBear

Reputation: 9615

Gulp error on node_module that has scss

I recently npm installed the node module react-calendar-timeline .

After implementing it one of my components, I ran gulp to build.

gulp threw an error:

events.js:141
      throw er; // Unhandled 'error' event
      ^
    SyntaxError:
    /var/www/monitor/node_modules/react-calendar-timeline/modules/lib/Timeline.scss:1
    $item-color: white;
               ^
    ParseError: Unexpected token

My gulpfile file for this component looks like this:

var gulp = require('gulp');
var browserify = require('gulp-browserify');
var concat = require('gulp-concat');
var babel = require('gulp-babel');

gulp.task('browserify', function() {
    gulp.src('js/ScheduleMain.js')
      .pipe(browserify({transform:'babelify'}))
      .pipe(concat('ScheduleMain.js'))
      .pipe(gulp.dest('static/dist/js'));

It seems as though I am not able to handle the .scss file of the module I have installed. What is the proper way to handle this?

Upvotes: 0

Views: 209

Answers (1)

user4401761
user4401761

Reputation:

It could be an issue related more to gulp-browserify than your build script.

Keep in mind that gulp-browserify is long dead, in fact it's been more than an year since the last update; this is from it's npm page:

NOTE: THIS PLUGIN IS NO LONGER MAINTAINED , checkout the recipes by gulp team for reference on using browserify with gulp.

Browserify natively supports streming and with just a pair of plugins you can trasform that stream to be gulp compatible, I suggest you to take a look at gulp's examples folder, more specifically to this example using browserify.

By the way, what's the point in running gulp-concat when in your stream theres only one file?

Upvotes: 1

Related Questions