-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
168 lines (165 loc) · 6.19 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
module.exports = function (grunt) {
grunt.initConfig({
jshint: {
files: ['Gruntfile.js', 'test/**/*.js'],
options: {
globals: {}
}
},
pkg: grunt.file.readJSON('package.json'),
browserify: {
vendor: {
src: [],
dest: 'parse/public/scripts/vendor.js',
options: {
require: ['jquery', 'bootstrap', 'react', 'classnames', 'react-bootstrap', 'react-router', 'react-chartjs', 'tcomb-form', './client/scripts/formI18nUtils.js', './client/scripts/formGenerationUtils.js', './client/scripts/Services.js', './client/scripts/AdminServices.js'],
transform: ['reactify'],
}
},
ceek: {
src: ['client/scripts/*.js'],
dest: 'parse/public/scripts/bundle.js',
options: {
transform: ['reactify'],
alias: [
'./client/scripts/app.js:App',
'./client/scripts/nav.js:CeekNav',
'./client/scripts/busyindicator.js:BusyIndicator',
'./client/scripts/signup.js:SignUp',
'./client/scripts/user.js:User',
'./client/scripts/userprofileheader.js:UserProfileHeader',
'./client/scripts/cards.js:Cards',
'./client/scripts/expirationdatecountdown.js:ExpirationDateCountDown',
'./client/scripts/usermatches.js:UserMatches',
'./client/scripts/userview.js:UserView',
'./client/scripts/jobmatchingconfirmationmessage.js:JobMatchingConfirmationMessage'
],
external: ['react'],
browserifyOptions: {
debug: true
}
}
},
ceekmock: {
src: [],
dest: 'parse/public/scripts/mock.js',
options: {
require: ['./server/cloud/formConfig.js', './server/cloud/mock.js'],
alias: [
'./server/cloud/formConfig.js:formConfig.js',
'./server/cloud/mock.js:Mock'
]
}
},
ceekadmin: {
src: ['client/scripts/admin/*.js'],
dest: 'parse/public/scripts/adminbundle.js',
options: {
transform: ['reactify'],
alias: [
'./client/scripts/admin/filterabletable.js:FilterableTable',
'./client/scripts/admin/userstable.js:UsersTable'
],
external: ['react'],
browserifyOptions: {
debug: true
}
}
},
matches: {
src: ['client/scripts/matches.js'],
dest: 'parse/public/scripts/matches.js',
options: {
transform: ['reactify'],
alias: [
'./client/scripts/cards.js:Cards',
'./client/scripts/expirationdatecountdown.js:ExpirationDateCountDown',
'./client/scripts/userview.js:UserView',
'./client/scripts/matches.js:Matches'
],
external: ['react'],
browserifyOptions: {
debug: true
}
}
}
},
watch: {
vendor: {
files: ['Gruntfile.js'],
tasks: ['default', 'copy:vendor']
},
parse: {
files: ['client/**/*', 'server/**/*'],
tasks: ['jshint', 'browserify:ceek', 'browserify:ceekadmin', 'browserify:matches', 'copy:client', 'copy:server']
}
},
copy: {
client: {
expand: true,
cwd: 'client',
dest: 'parse/public/',
src: ['**/*.css', '**/*.html', '**/*.png', '**/*.jpg', '**/*.ttf']
},
ceekmock: {
src: ['client/scripts/mock.js'],
dest: 'parse/public/scripts/mock.js'
},
server: {
expand: true,
cwd: 'server',
dest: 'parse/cloud/',
src: '**/*'
},
server_cloud: {
expand: true,
cwd: 'server/cloud/',
dest: 'parse/cloud/',
src: '**/*'
},
vendor: {
files: [
{
expand: true,
cwd: 'node_modules/',
src: ['bootstrap/dist/css/bootstrap.min.css',
'bootstrap/dist/css/bootstrap-theme.min.css'],
dest: 'parse/public/css/',
flatten: true
},
{
expand: true,
cwd: 'node_modules/',
src: ['bootstrap/dist/fonts/*'],
dest: 'parse/public/fonts/',
flatten: true
}]
}
},
clean: {
parse: {
files: [{
dot: true,
src: [
'parse/cloud/*',
'parse/public/*',
]
}]
}
},
exec: {
serve: 'cd parse/ && export CEEK_LOCAL=1 && parsedev &',
deploy: 'cd parse/ && parse deploy'
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-exec');
grunt.registerTask('default', ['jshint', 'browserify']);
grunt.registerTask('build', ['clean', 'default', 'copy']);
grunt.registerTask('serve', ['build', 'exec:serve', 'watch']);
grunt.registerTask('deploy', ['exec:deploy']);
};