Created
December 24, 2016 11:47
-
-
Save Cside/14963f34e0a11580426c26b6f0f1a3a6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var browserify = require('browserify'); | |
var babelify = require('babelify'); | |
var source = require('vinyl-source-stream'); | |
var webserver = require('gulp-webserver'); | |
gulp.task('browserify', function() { | |
browserify('./src/index.js', { debug: true }) | |
.transform(babelify) | |
.bundle() | |
.on("error", function (err) { console.log("Error : " + err.message); }) | |
.pipe(source('bundle.js')) | |
.pipe(gulp.dest('./')) | |
}); | |
gulp.task('watch', function() { | |
gulp.watch('./src/**/*.js', ['browserify']) | |
}); | |
gulp.task('webserver', function() { | |
gulp.src('./') | |
.pipe(webserver({ | |
host: '127.0.0.1', | |
livereload: true | |
}) | |
); | |
}); | |
gulp.task('default', ['browserify', 'watch', 'webserver']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment