-
Notifications
You must be signed in to change notification settings - Fork 7
/
Gruntfile.js
66 lines (49 loc) · 1.67 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
/*global module:false */
// The line above is used for jshint plugins in your IDE
/**
* This file is used when running npm test
* @param grunt
*/
module.exports = function (grunt) {
'use strict';
var project = {
dirs: {
input : 'test/input',
output : 'test/output',
temp : 'temp'
},
files: {
scripts : '/scripts',
vendor : '/scripts/vendor',
any : '/**/*',
thisDir : '/*',
dot : {
javascript : '.js',
html : '.html'
}
}
},
gruntConfig = {
// allow grunt tasks easy access to the project object
project: project,
pkg: grunt.file.readJSON('package.json'),
// Copy things to a temp dir, and only change things in the temp dir
copy: {
test: {
files: [
{expand: true, cwd: 'test/input/', src : ['**'], dest: 'test/output/' }
]
}
},
// Useref will got through all html files in output
useref: {
html: project.dirs.output + project.files.any + project.files.dot.html,
temp: project.dirs.output
}
};
grunt.initConfig(gruntConfig);
grunt.loadNpmTasks('grunt-bump');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadTasks('./tasks/');
grunt.registerTask('test', ['copy', 'useref', 'concat', 'uglify', 'cssmin']);
};