-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdev.js
executable file
·61 lines (53 loc) · 1.26 KB
/
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
const nodemon = require('nodemon');
const fs = require('fs');
const path = require('path');
const clean = require('./devTools/clean');
require('dotenv').config();
const watchable = require('./devTools/htmlStringEditor');
const bundler = require('./devTools/bundler')
const {
spawn
} = require('child_process');
console.clear();
const cleanFiles = [ /*'.parcel-cache/*',*/ 'modules/han1-dash/dash/*']
const nodemonOpts = {
verbose: true,
ignore: [
'node_modules',
'demodata/*',
'src/*',
'modules/han1-dash/dash/*',
'.parcel-cache/*',
'devTools/*'
],
watch: ['.*'],
restartable: 'rs',
colours: true,
execMap: [Object],
stdin: true,
runOnChangeOnly: false,
signal: 'SIGUSR2',
stdout: true,
watchOptions: {},
};
const watchableOpts = {
path: 'modules/han1-dash/dash/',
ext: '.html',
func: async (inp) => {
let output, has;
has = inp.match(/(?:\<script){1}(?:\ src="){1}(http:\/\/scramblebamble.let\/socket.io\/socket.io.js){1}(\"\>){1}(\<\/script\>){1}/gi);
if (has) {
output = inp.replace(/(http:\/\/scramblebamble.let)/gi, '')
return output
} else {
return
}
},
watch: true
}
clean(cleanFiles)
.then(() => {
bundler.bundle()
nodemon(nodemonOpts)
watchable(watchableOpts)
});