-
Notifications
You must be signed in to change notification settings - Fork 0
/
gruntfile.js
93 lines (85 loc) · 1.79 KB
/
gruntfile.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
86
87
88
89
90
91
92
93
module.exports = function (grunt) {
var data = require('./app/version.json')
grunt.initConfig({
watch: {
client: {
files: 'app/*.ts',
tasks: [
'exec:compile',
'copy:bundle',
'exec:aot',
],
options: {
debounceDelay: 1000,
},
},
},
exec: {
nextVersion: {
command: 'node tools/nextVersion',
},
index: {
command: 'npm run index',
},
compileServer: {
command: 'npm run compile-server',
},
compile: {
command: 'npm run compile',
},
aot: {
command: 'npm run aot',
},
generateSitemap: {
command: 'npm run generateSitemap',
},
add: {
command: 'git add .',
},
commit: {
command: `git commit -m"Release v${data.version + 1}"`,
},
push: {
command: 'git push azure master',
},
},
copy: {
bundle: {
files: [
{ src: ['app/GA.js'], dest: 'aot/GA.js' },
{ src: ['dist/bundle.js'], dest: 'aot/bundle.js' },
{ src: ['dist/sw.js'], dest: 'aot/sw.js' },
],
},
},
})
grunt.loadNpmTasks('grunt-exec')
grunt.loadNpmTasks('grunt-contrib-copy')
grunt.loadNpmTasks('grunt-contrib-watch')
grunt.registerTask('schema', [
'exec:compileSchema',
'exec:schema',
'copy:schema',
])
grunt.registerTask('server', [
'exec:compileServer',
// 'exec:generateSitemap',
])
grunt.registerTask('client', [
'exec:nextVersion',
'exec:compile',
'copy:bundle',
'exec:aot',
])
grunt.registerTask('default', [
'schema',
'server',
'client',
])
grunt.registerTask('release', [
'default',
'exec:add',
'exec:commit',
'exec:push',
])
}