Skip to content

Instantly share code, notes, and snippets.

@zabirauf
Created October 19, 2015 00:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zabirauf/a36b3c47ab9ae68c60d3 to your computer and use it in GitHub Desktop.
Save zabirauf/a36b3c47ab9ae68c60d3 to your computer and use it in GitHub Desktop.
Gulpfile for a bower library
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