-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathGruntfile.js
66 lines (61 loc) · 1.82 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
/*jshint camelcase: false */
/*global module:false */
module.exports = function(grunt) {
grunt.initConfig({
// uglify: {
// 'dist/built.min.js': 'dist/built.js'
// },
neuter: {
'build/application.js': 'app/app.js'
},
watch: {
application_code: {
files: ['dependencies/ember.js', 'app/**/*.js'],
tasks: ['neuter']
},
handlebars_templates: {
files: ['app/**/*.hbs'],
tasks: ['ember_templates', 'neuter']
}
},
// qunit: {
// all: ['test/**/*.html']
// },
jshint: {
all: ['Gruntfile.js', 'app/**/*.js', 'test/**/*.js', '!dependencies/*.*'],
options: {
jshintrc: '.jshintrc'
}
},
ember_templates: {
options: {
templateName: function(sourceFile) {
return sourceFile.replace(/app\/templates\//, '');
}
},
'dependencies/compiled/templates.js': ["app/templates/*.hbs"]
},
test_runner_file: {
all: ['test/**/*_test.js']
}
});
// grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
// grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-neuter');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-ember-templates');
// grunt.registerMultiTask('test_runner_file', 'Creates a test runner file.', function(){
// var tmpl = grunt.file.read('test/support/base.html.tmpl');
// var renderingContext = {
// data: {
// files: this.file.src.map(function(path){
// return path.replace('test/', '');
// })
// }
// };
// grunt.file.write('test/base.html', grunt.template.process(tmpl, renderingContext));
// });
// Default task.
// grunt.registerTask('default', ['jshint', 'neuter', 'test_runner_file', 'qunit']);
};