Skip to content

Commit

Permalink
screen-space-reflection add missing build script
Browse files Browse the repository at this point in the history
  • Loading branch information
vorg committed Jan 17, 2017
1 parent ba4726d commit 1159d71
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions screen-space-reflections/lib/watchscript.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/usr/bin/env node

var fs = require('fs');
var browserify = require('browserify');
var watchify = require('watchify');
var browserSync = require('browser-sync');
var b = browserify(watchify.args);

function watch() {
b.add('./main.js');

b.transform({global:true}, 'brfs');
b.ignore('plask');

var bundler = watchify(b);
bundler.on('update', rebundle);

function rebundle () {
return bundler.bundle()
// log errors if they happen
.on('error', function(e) {
console.log('Browserify Error', e);
})
.pipe(fs.createWriteStream('main.web.js'))
browserSync.reload();
}

return rebundle()

}

watch();


var files = [
'./main.web.js'
];

browserSync.init(files, {
server: {
baseDir: './'
}
});




0 comments on commit 1159d71

Please sign in to comment.