forked from nicklargent/scrumwithme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.coffee
126 lines (93 loc) · 3.39 KB
/
Gruntfile.coffee
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
module.exports = (grunt) ->
# config
grunt.initConfig
pkg: grunt.file.readJSON("package.json")
appVersion: grunt.template.today('yyyymmddHHMM')
files:
js:
vendor: [
"public/vendor/angular/angular.min.js"
"public/vendor/angular/angular-cookies.min.js"
]
src: [
"public/src/js/ScrumWithMe.js"
"public/src/js/controllers/IndexCtrl.js"
"public/src/js/controllers/ClientCtrl.js"
"public/src/js/controllers/ServerCtrl.js"
"public/src/js/controllers/TestCtrl.js"
"public/src/js/services/socket.js"
"public/src/js/services/tools.js"
]
css:
src: ["public/src/css/**/*.css"]
html:
src: ["*.html"]
# tasks
clean:
workspaces: ['public/dist', 'build', 'scrumwithme.*.zip']
open:
dev:
path: "http://localhost:4000"
jshint:
src: "<%=files.js.src%>"
concat:
app_js:
dest: 'public/dist/js/app.min.js'
src: ["<%=files.js.src%>"]
vendor_js:
dest: 'public/dist/js/vendor.min.js'
src: ["<%=files.js.vendor%>"]
app_css:
dest: 'public/dist/css/app.css'
src: ["<%=files.css.src%>"]
uglify:
#options:
#banner: "hi"
dist:
src: "<%=concat.app_js.dest %>"
dest: "<%=concat.app_js.dest %>"
copy:
build:
src: ["app/**", "public/**", ".ebextensions/**", "package.json", "!public/src/**", "!public/vendor/**"]
dest: "build"
expand: true
replace:
all:
src: ['public/dist/js/app.min.js']
overwrite: true
replacements: [
from: "{{APP.VERSION}}"
to: "<%=appVersion%>"
]
compress:
build:
options:
archive: "<%=pkg.name%>.<%=appVersion%>.zip"
mode: "zip"
cwd: "build"
src: ["**"]
watch:
options:
livereload: true
js:
files: "<%=files.js.src%>"
tasks: ["concat:app_js", 'replace']
css:
files: "<%=files.css.src%>"
tasks: ["concat:app_css", 'replace']
html:
files: "<%=files.html.src%>"
nodemon:
dev:
script: 'app/app.js'
options:
watch: ['app']
concurrent:
options:
logConcurrentOutput: true
tasks: ['nodemon', 'watch']
# load plugins
require('matchdep').filterAll('grunt-*').forEach(grunt.loadNpmTasks);
# create workflow
grunt.registerTask 'default', ['concat', 'replace', 'open', 'concurrent']
grunt.registerTask 'build', ['clean', 'jshint', 'concat', 'uglify', 'replace', 'copy:build', 'compress:build']