Skip to content

Instantly share code, notes, and snippets.

@ChrisCates
Created September 28, 2015 21:50
Show Gist options
  • Save ChrisCates/bdea4068ea975407a23d to your computer and use it in GitHub Desktop.
Save ChrisCates/bdea4068ea975407a23d to your computer and use it in GitHub Desktop.
'use strict';
var gulp = require('gulp');
var gutil = require('gulp-util');
var browserify = require('gulp-browserify');
var reactify = require('reactify');
var babelify = require('babelify');
var sass = require('gulp-sass');
var nodemon = require('gulp-nodemon');
gulp.task('node:start', function () {
nodemon({
script: 'app.js',
ext: 'js html',
env: { 'NODE_ENV': 'development' }
})
})
gulp.task('browserify', function() {
// Single entry point to browserify
gulp.src('./assets/frontend/js/app.js')
.pipe(browserify({
insertGlobals : true,
transform: [
reactify,
babelify,
],
debug : !gulp.env.production
}))
.pipe(gulp.dest('./public/js'))
});
gulp.task('sass', function () {
gulp.src('./assets/frontend/sass/**/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./public/css'));
});
gulp.task('sass:watch', function () {
gulp.watch('./assets/frontend/sass/**/*.scss', ['sass']);
});
gulp.task('default',
[
'sass',
'sass:watch',
'node:start',
'browserify'
]
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment