-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
screen-space-reflection add missing build script
- Loading branch information
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
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
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: './' | ||
} | ||
}); | ||
|
||
|
||
|
||
|