Created
October 19, 2015 00:09
-
-
Save zabirauf/a36b3c47ab9ae68c60d3 to your computer and use it in GitHub Desktop.
Gulpfile for a bower library
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'), | |
gutil = require('gulp-util'), | |
eslint = require('eslint'), | |
babelify = require('babelify'), | |
source = require('vinyl-source-stream'), | |
browserify = require('browserify'); | |
var paths = { | |
ALL: ['index.js', 'lib/*.js'], | |
JS: ['index.js', 'lib/*.js'], | |
OUT: 'calculationjs.js', | |
DEST: './', | |
ENTRY_POINT: './index.js' | |
}; | |
gulp.task('default', ['build']); | |
// Build the app | |
gulp.task('build', function() { | |
return browserify({ | |
extensions: ['js'], | |
entries: paths.ENTRY_POINT, | |
debug: true, | |
paths: './bower_components' | |
}) | |
.transform(babelify.configure({ | |
ignore: /(bower_components)|(node_modules)/ | |
})) | |
.bundle() | |
.on('error', gutil.log) | |
.pipe(source(paths.OUT)) | |
.pipe(gulp.dest(paths.DEST_BUILD)); | |
}); | |
gulp.task('watch', function() { | |
gulp.watch(paths.JS, ['build']); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment