-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGruntfile.js
129 lines (129 loc) · 4.07 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
'use strict';
module.exports = function (grunt) {
grunt.initConfig({
jshint: {
options: {
jshintrc: '.jshintrc'
},
all: [
'Gruntfile.js'
]
},
coffeelint: {
mobi_app:['mobi_app/**/*.coffee']
},
ember_handlebars: {
mobi_app: {
options: {
processName: function(fileName) {
var arr = fileName.split("."),
path = arr[arr.length - 2].split("/"),
name = path[path.length - 1],
isComponents = path.indexOf('components') > -1;
if(isComponents) {
return 'components/' + name;
}
else {
return name;
}
}
},
files: {
"mobi_app/debug/templates.js": ["mobi_app/templates/*.hbs","mobi_app/templates/components/*.hbs"]
}
}
},
coffee:{
mobi_app:{
files:{
"mobi_app/debug/app.js":"mobi_app/app.coffee",
"mobi_app/debug/store.js":"mobi_app/store.coffee",
"mobi_app/debug/models.js":"mobi_app/models/*.coffee",
"mobi_app/debug/controllers.js":"mobi_app/controllers/*.coffee",
"mobi_app/debug/views.js":"mobi_app/views/*.coffee",
"mobi_app/debug/helpers.js":"mobi_app/helpers/*.coffee",
"mobi_app/debug/router.js":"mobi_app/router.coffee",
"mobi_app/debug/routes.js":"mobi_app/routes/*.coffee",
"mobi_app/debug/init.js":"mobi_app/init.coffee"
}
}
},
concat:{
vendor:{
src:[
"bower_components/jquery/dist/jquery.js",
"bower_components/modernizr/modernizr.js",
"bower_components/foundation/js/foundation.js",
"bower_components/handlebars/handlebars.js",
"bower_components/ember/ember.js",
"bower_components/ember-data/ember-data.js"
],
dest:"mobi_app/debug/lib.js"
},
mobi_app_only:{
src:["mobi_app/debug/app.js",
"mobi_app/debug/store.js",
"mobi_app/debug/models.js",
"mobi_app/debug/controllers.js",
"mobi_app/debug/views.js",
"mobi_app/debug/helpers.js",
"mobi_app/debug/templates.js",
"mobi_app/debug/routes.js",
"mobi_app/debug/router.js",
"mobi_app/debug/init.js"],
dest:"mobi_app/debug/mobi_app_only.js"
},
mobi_app:{
src:["mobi_app/debug/lib.js",
"mobi_app/debug/mobi_app_only.js"],
dest:"mobi_app/debug/mobi_app.js"
}
},
sass: {
options: {
includePaths: ['bower_components/foundation/scss']
},
dist: {
options: {
outputStyle: 'compressed'
},
files: {
'mobi_themes/debug/default/main.css': 'mobi_themes/src/default/main.scss'
}
}
},
connect:{
mobi_app:{
options:{
port: 9000,
base: 'mobi_app/debug'
}
}
},
watch:{
mobi_app_coffee:{
files:'mobi_app/debug/**/*.coffee',
tasks:['coffeelint','coffee:mobi_app','concat:mobi_app']
},
mobi_app_handlebars:{
files:'mobi_app/templates/**/*.hbs',
tasks:['ember_handlebars:mobi_app','concat:mobi_app']
}
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-coffeelint');
grunt.loadNpmTasks('grunt-contrib-coffee');
grunt.loadNpmTasks('grunt-ember-handlebars');
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.registerTask('default', ['jshint','coffeelint','ember_handlebars:mobi_app', 'coffee:mobi_app','concat:vendor','concat:mobi_app_only','concat:mobi_app', 'sass', 'connect:mobi_app', 'watch']);
};