-
Notifications
You must be signed in to change notification settings - Fork 20
/
Gruntfile.js
95 lines (84 loc) · 2.34 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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
files: {
js: [
"js/todoTxt.js",
"js/objects/utils.js",
"js/classes/task.js",
"js/objects/view.js",
"js/objects/resources.js",
"js/objects/resources/en-us.js",
"js/wrapper.js",
],
css: [
"css/todoTxt.css",
],
tests: "tests/qunit/allTests.html",
functionalTests: ["tests/pft/tests/**/*.js"]
},
clean: {
build: {
src: ['dist/**/*','results/**/*','img/**/*'],
filter: 'isFile',
},
},
uglify: {
options: {
mangle: true,
compress: {},
sourceMap: true,
},
build: {
options: {
banner: '/*! <%= pkg.name %> v<%= pkg.version %>, created by: <%= pkg.author %> <%= grunt.template.today("yyyy-mm-dd HH:MM:ss") %> */'
},
files: {
'dist/<%= pkg.main %>.min.js': ['<%= files.js %>']
}
},
},
cssmin: {
build: {
files: {
'dist/<%= pkg.main %>.min.css': ['<%= files.css %>']
}
},
},
qunit: {
all: ['<%= files.tests %>']
},
pft: {
options: {
parallel: 3,
// debug: true
},
src: ['<%= files.functionalTests %>']
},
jsdoc: {
dist: {
src: ['<%= files.js %>'],
dest: 'dist/doc'
}
}
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-uglify');
// Load the plugin that provides the "cssmin" task.
grunt.loadNpmTasks('grunt-contrib-cssmin');
// Load the plugin that provides the "clean" task.
grunt.loadNpmTasks('grunt-contrib-clean');
// This plugin provides the "qunit" task.
grunt.loadNpmTasks('grunt-contrib-qunit');
// This plugin provides the "casper" task.
grunt.loadNpmTasks('grunt-pft');
// This plugin provides the "qunit" task.
grunt.loadNpmTasks('grunt-jsdoc');
// Default task(s).
grunt.registerTask('default', ['clean','qunit','uglify','cssmin','pft','jsdoc']);
// Build only task(s).
grunt.registerTask('build', ['clean','uglify','cssmin']);
// document only task(s).
grunt.registerTask('doc', ['jsdoc']);
};