-
Notifications
You must be signed in to change notification settings - Fork 5
/
Gruntfile.js
55 lines (53 loc) · 1.7 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
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-ember-template-compiler');
grunt.loadNpmTasks('grunt-hashres');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.initConfig({
watch: {
scripts: {
files: ['ember/static/script/**/*.js', 'ember/static/script/templates/*.handlebars'],
tasks: ['dev'],
options: {
interrupt: true,
debounceDelay: 250
}
}
},
hashres: {
options: {
renameFiles: true
},
prod: {
src: ['ember/static/script/lib/deps.min.js'],
dest: 'ember/person/templates/index.html'
}
},
concat: {
dist: {
src: [
'ember/static/script/vendor/jquery-1.9.1.js',
'ember/static/script/vendor/handlebars.js',
'ember/static/script/vendor/ember.js',
'ember/static/script/app/person.js',
'ember/static/script/lib/tmpl.min.js'],
dest: 'ember/static/script/lib/deps.min.js'
}
},
emberhandlebars: {
compile: {
options: {
templateName: function(sourceFile) {
var newSource = sourceFile.replace('ember/static/script/templates/', '');
return newSource.replace('.handlebars', '');
}
},
files: ['ember/static/script/templates/*.handlebars'],
dest: 'ember/static/script/lib/tmpl.min.js'
}
}
});
grunt.task.registerTask('dev', ['emberhandlebars', 'concat:dist']);
grunt.task.registerTask('local', ['dev', 'watch']);
grunt.task.registerTask('deploy', ['emberhandlebars', 'concat:dist', 'hashres']);
}