-
Notifications
You must be signed in to change notification settings - Fork 1k
/
Copy pathdev.js
48 lines (44 loc) · 1.35 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
import terminalLink from 'terminal-link'
import { checkNodeVersion } from '../middleware/checkNodeVersion'
export const command = 'dev [side..]'
export const description = 'Start development servers for api, and web'
export const builder = (yargs) => {
yargs
.positional('side', {
choices: ['api', 'web'],
default: ['api', 'web'],
description: 'Which dev server(s) to start',
type: 'array',
})
.option('forward', {
alias: 'fwd',
description:
'String of one or more Webpack DevServer config options, for example: `--fwd="--port=1234 --no-open"`',
type: 'string',
})
.option('generate', {
type: 'boolean',
default: true,
description: 'Generate artifacts',
})
.option('watchNodeModules', {
type: 'boolean',
description: 'Reload on changes to node_modules',
})
.option('apiDebugPort', {
type: 'number',
description:
'Port on which to expose API server debugger. If you supply the flag with no value it defaults to 18911.',
})
.middleware(checkNodeVersion)
.epilogue(
`Also see the ${terminalLink(
'Redwood CLI Reference',
'https://redwoodjs.com/docs/cli-commands#dev'
)}`
)
}
export const handler = async (options) => {
const { handler } = await import('./devHandler.js')
return handler(options)
}