-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.js
More file actions
executable file
·33 lines (25 loc) · 794 Bytes
/
cli.js
File metadata and controls
executable file
·33 lines (25 loc) · 794 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
#!/usr/bin/env node
const path = require('path')
const yargs = require('yargs')
const { yellow } = require('chalk')
const nodeDev = require('./index')
const args = yargs
.option('config', {
alias: 'c',
default: 'webpack.config.js',
description: 'The path to the webpack config file',
})
.help()
.argv
let config
try {
config = require(path.resolve(args.config))
} catch (error) {
console.error(`Could not resolve webpack config file ${args.config}`)
process.exit(1)
}
console.log(yellow('============================================'))
console.log(yellow(`Starting development process`))
console.log(yellow('============================================'))
console.log(yellow('Enter commands: restart, debug, normal'))
nodeDev(config)