Skip to content

Commit

Permalink
renew outlog to 1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
aclever committed May 21, 2017
1 parent b14992f commit f6c0a88
Show file tree
Hide file tree
Showing 11 changed files with 651 additions and 124 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea
node_modules
298 changes: 298 additions & 0 deletions build/build.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions build/build.js.map

Large diffs are not rendered by default.

49 changes: 49 additions & 0 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
'use strict';

import gulp from 'gulp';
import source from 'vinyl-source-stream'
import buffer from 'vinyl-buffer'
import babel from 'babelify'
import watchify from 'watchify'
import sourcemaps from 'gulp-sourcemaps'
import browserify from 'browserify'


function compile(watch) {
let bundler = watchify(browserify('./src/index.js', {debug: true}).transform(babel));

function rebundle() {
bundler.bundle()
.on('error', (err)=> {
console.error(err);
this.emit('end');
})
.pipe(source('build.js'))
.pipe(buffer())
.pipe(sourcemaps.init({loadMaps: true}))
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('./build'));
}

if (watch) {
bundler.on('update', () => {
console.log('-> bundling...');
rebundle();
});
}

rebundle();
}

function watch() {
return compile(true);
}

gulp.task('build', () => {
return compile();
});
gulp.task('watch', () => {
return watch();
});

gulp.task('default', ['watch']);
Loading

0 comments on commit f6c0a88

Please sign in to comment.