forked from edankwan/The-Spirit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dev.js
27 lines (26 loc) · 737 Bytes
/
dev.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const budo = require('budo');
const path = require('path');
const opn = require('opn');
const fs = require('fs');
const simpleHtml = require('simple-html-index');
var entryPath = path.resolve('src', 'index.js');
budo(entryPath, {
serve: 'js/index.js',
live: true,
dir: __dirname + '/app',
stream: process.stdout,
defaultIndex: function (opt) {
var html = 'index.html';
if (!fs.existsSync(html)) return simpleHtml(opt);
return fs.createReadStream(html);
},
browserify: {
transform: [
[ 'installify', { save: true } ],
['glslify', { global: true }]
]
}
}).on('connect', function(ev) {
const uri = ev.uri + 'index.html';
opn(uri);
});