-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathGruntfile.js
96 lines (91 loc) · 2.69 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
'use strict';
var
LIVERELOAD_PORT = 35729,
lrSnippet = require('connect-livereload')({port: LIVERELOAD_PORT}),
mountFolder = function (connect, dir) {
return connect.static(require('path').resolve(dir));
};
module.exports = function (grunt) {
// load all grunt tasks
require('load-grunt-tasks')(grunt);
grunt.initConfig({
emberTemplates: {
compile: {
options: {
templateBasePath: /templates\//
},
files: {
"js/dist/templates.js": "**/*.handlebars"
}
}
},
stylus: {
compile: {
options: {
paths: ['stylus/'],
import: ['../variables']
},
files: {
'css/style.css' : 'css/stylus/*.styl',
}
}
},
uglify: {
my_target: {
files: {
"js/dist/app.js": ["js/src/application.js","js/src/router.js","js/src/routes/*","js/src/models/*","js/src/views/*","js/src/controllers/*","js/src/components/*","js/src/fixtures/*"]
}
}
},
watch: {
files: [
'index.html',
'js/**/*.js'
],
ember_templates: {
files: 'templates/**/*.handlebars',
tasks: ['emberTemplates']
},
stylus: {
files: ['css/**/*.styl'],
tasks: ['stylus']
},
uglify: {
files: ["js/src/application.js","js/src/router.js","js/src/routes/*","js/src/models/*","js/src/views/*","js/src/controllers/*","js/src/components/*","js/src/fixtures/*"],
tasks: ['uglify']
},
livereload: {
options: { livereload: LIVERELOAD_PORT },
files: ['css/style.css', 'index.html', 'js/**/*.js']
}
},
connect: {
options: {
port: 3000,
hostname: '0.0.0.0'
},
livereload: {
options: {
middleware: function( connect ) {
return [
lrSnippet,
mountFolder(connect, './')
];
}
}
}
}
});
grunt.registerTask('server', function() {
grunt.task.run([
'connect:livereload',
'watch'
]);
});
grunt.registerTask('default', [
'stylus',
'uglify',
'emberTemplates',
'server'
]);
};