-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.js
More file actions
41 lines (32 loc) · 722 Bytes
/
index.js
File metadata and controls
41 lines (32 loc) · 722 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
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env node
const {
asset,
name,
on,
port,
dest,
debugPagePath,
debugPageTitle,
loggerTitle
} = require('berber')
const pkg = require('./package')
const pipeline = require('./pipeline')
name(pkg.name)
loggerTitle(pkg.name)
debugPagePath(`__${pkg.name}__`)
debugPageTitle(`<i>${pkg.name}</i> debug page`)
const defaultConfig = {
port: 26000,
dest: 'build',
title: 'Language Data Table'
}
on('config', config => {
config = Object.assign({}, defaultConfig, config)
if (!config.source) {
console.log(`Error: 'source' is not specified.\nSee ${pkg.homepage} for details.`)
process.exit(1)
}
port(config.port)
dest(config.dest)
pipeline(asset(config.source), config)
})