Skip to content

Instantly share code, notes, and snippets.

@krrg
Created November 24, 2015 21:34
Show Gist options
  • Save krrg/1faa11e989c146c35e87 to your computer and use it in GitHub Desktop.
Save krrg/1faa11e989c146c35e87 to your computer and use it in GitHub Desktop.
Reactify and Browserify and SCSS
var gulp = require('gulp')
var browserify = require('browserify');
var source = require('vinyl-source-stream');
var reactify = require('reactify');
var sass = require('gulp-sass');
gulp.task('browserify', function () {
var b = browserify();
b.transform(reactify);
b.add('./js/routes.js'); // The root file
return (
b.bundle()
.pipe(source('app.js')) // What the output file should be named
.pipe(gulp.dest('./__build__')) // And what directory it should go to
);
});
gulp.task('scss', function () {
gulp.src('scss/**/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./__build__'))
});
gulp.task('default', ['browserify', 'scss']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment