forked from WatWowMap/ReactMap
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathReactMap.js
More file actions
30 lines (28 loc) · 820 Bytes
/
Copy pathReactMap.js
File metadata and controls
30 lines (28 loc) · 820 Bytes
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
// @ts-check
/* eslint-disable import/no-extraneous-dependencies */
const { build } = require('vite')
const { log, TAGS } = require('@rm/logger')
const { generate, read } = require('@rm/masterfile')
generate(true)
.catch((generationError) => {
let masterfile
try {
masterfile = read()
} catch (readError) {
log.warn(TAGS.masterfile, 'Unable to refresh masterfile', generationError)
throw readError
}
log.warn(
TAGS.masterfile,
'Unable to refresh masterfile, using existing.',
generationError,
)
return masterfile
})
.then(() => build())
.then(() => log.info(TAGS.build, 'React Map Compiled'))
.then(() => require('./server/src/index'))
.catch((e) => {
log.error(TAGS.ReactMap, 'Unable to start ReactMap', e)
process.exitCode = 1
})