Skip to content
This repository has been archived by the owner on Jun 1, 2020. It is now read-only.

Commit

Permalink
Merge pull request #16 from Rulox/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Rulox authored Sep 20, 2016
2 parents 1486e2b + 1e37c15 commit da0bd70
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions Gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var sourcemaps = require('gulp-sourcemaps');
// Static Server + watching scss/html files
gulp.task('serve', ['sass', 'js'], function() {
browserSync.init({
server: './public'
server: './public'
});
gulp.watch('app/**/*.scss', ['sass']);
gulp.watch('app/**/*.js', ['js']);
Expand All @@ -42,30 +42,30 @@ gulp.task('jslint', function() {
// Compile sass into CSS & auto-inject into browsers
gulp.task('sass', ['stylelint'], function() {
return gulp.src('./app/main.scss')
.pipe(sass().on('error', sass.logError))
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(sourcemaps.init({ loadMaps: true }))
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('./public/css'))
.pipe(browserSync.stream())
.pipe(notify({message: 'CSS created!', onLast: true}));
.pipe(sass().on('error', sass.logError))
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(sourcemaps.init({ loadMaps: true }))
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('./public/css'))
.pipe(browserSync.stream())
.pipe(notify({message: 'CSS created!', onLast: true}));
});

// Transpile ES6 js (React app) into JS & auto-inject into browsers
gulp.task('js', ['jslint'], function() {
var bundler = browserify('./app/app.js').transform("babelify", {presets: ["es2015", "react"]});
return bundler.bundle()
.on('error', function(err) { console.error(err); this.emit('end'); })
.pipe(source('app.js'))
.pipe(buffer())
.pipe(sourcemaps.init({ loadMaps: true }))
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('./public/js/'))
.pipe(browserSync.stream())
.pipe(notify({message: 'JS bundle created!', onLast: true}));
.on('error', function(err) { console.error(err); this.emit('end'); })
.pipe(source('app.js'))
.pipe(buffer())
.pipe(sourcemaps.init({ loadMaps: true }))
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('./public/js/'))
.pipe(browserSync.stream())
.pipe(notify({message: 'JS bundle created!', onLast: true}));
});

// Tasks
Expand Down

0 comments on commit da0bd70

Please sign in to comment.