-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathdev.js
29 lines (28 loc) · 798 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
28
29
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', entry + '.js');
// console.log(entryPath)
// budo(entryPath, {
budo('src/index.js', {
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);
});