forked from Akryum/vue-cli-plugin-ssr
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathui.js
85 lines (79 loc) · 2.33 KB
/
ui.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
module.exports = api => {
const taskCommon = {
prompts: [
{
name: 'port',
type: 'input',
default: '',
description: 'Specify port',
},
{
name: 'host',
type: 'input',
default: '',
description: 'Specify host',
},
{
name: 'server',
type: 'input',
default: '',
description: 'Specify local server path (absolute from root project)',
},
{
name: 'config',
type: 'input',
default: '',
description: 'Specify local config path (absolute from root project)',
},
],
onBeforeRun: ({ answers, args }) => {
if (answers.port) args.push('--port', answers.port)
if (answers.host) args.push('--host', answers.host)
if (answers.server) args.push('--server', answers.server)
if (answers.config) args.push('--config', answers.config)
},
}
const taskBuild = {
prompts: [
{
name: 'modern',
type: 'confirm',
default: false,
description: 'Build in modern mode',
},
],
onBeforeRun: ({ answers, args }) => {
if (answers.modern) args.push('--modern')
},
}
api.describeTask({
match: /vue-cli-service ssr:serve --mode production/,
description: 'Starts the HTTP server for SSR in production',
link: 'https://github.com/djodjonx/vue-cli-plugin-ssr#usage',
...taskCommon,
})
api.describeTask({
match: /vue-cli-service ssr:serve/,
description: 'Compiles and hot-reloads for development with SSR',
link: 'https://github.com/djodjonx/vue-cli-plugin-ssr#usage',
...taskCommon,
})
api.describeTask({
match: /vue-cli-service ssr:build/,
description: 'Compiles and minifies for production with SSR',
link: 'https://github.com/djodjonx/vue-cli-plugin-ssr#usage',
...taskBuild,
})
api.describeTask({
match: /vue-cli-service ssr:build-modern/,
description: 'Compiles and minifies application in modern mode for production with SSR',
link: 'https://github.com/djodjonx/vue-cli-plugin-ssr#usage',
...taskBuild,
})
api.describeConfig({
id: 'org.vue.vssr',
name: 'Vssr configuration',
description: 'Turn your Vue app into an isomorphic SSR app, with customizable koa Server',
link: 'https://github.com/djodjonx/vue-cli-plugin-ssr',
})
}