-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.js
More file actions
137 lines (131 loc) · 3.31 KB
/
Gruntfile.js
File metadata and controls
137 lines (131 loc) · 3.31 KB
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
"use strict";
module.exports = function ( grunt ) {
grunt.initConfig({
"pkg": grunt.file.readJSON("./package.json"),
"clean": {
"dist": "./dist/",
"foo-utils": "./dist/foofields.utils.js",
"jsdoc": "./docs/jsdocs"
},
"foo-utils": {
"options": {
"namespace": "FooFields.utils",
"dest": "./dist/foofields.utils.js"
}
},
"concat": {
"options": {
},
"build": {
"files": {
"./dist/js/foofields.js": [
"./src/js/__config.js",
"./dist/foofields.utils.js",
"./src/js/__static.js",
"./src/js/Instance.js",
"./src/js/Component.js",
"./src/js/Container.js",
"./src/js/Content.js",
"./src/js/Fields.js",
"./src/js/Field.js",
"./src/js/Tab.js",
"./src/js/TabMenu.js",
"./src/js/TabMenuItem.js",
// "./src/js/fields/*.js",
"./src/js/__init.js"
],
"./dist/css/foofields.css": [
"./src/css/Container.css",
"./src/css/Content.css",
"./src/css/Field.css",
"./src/css/tabs/Tabs.css",
"./src/css/tabs/Tab.css",
"./src/css/tabs/TabMenu.css",
"./src/css/tabs/TabMenuItem.css",
"./src/css/styles/Metabox.css"
]
}
}
},
"uglify": {
"options": {
"preserveComments": false,
"banner": '/*\n' +
'* <%= pkg.title %> - <%= pkg.description %>\n' +
'* @version <%= pkg.version %>\n' +
'* @link <%= pkg.homepage %>\n' +
'* @copyright Steven Usher & Brad Vincent 2015\n' +
'* @license Released under the GPLv3 license.\n' +
'*/\n'
},
"build": {
"files": {
"./dist/js/foofields.min.js": "./dist/js/foofields.js"
}
}
},
"cssmin": {
"options": {
"specialComments": false,
"banner": '/*\n' +
'* <%= pkg.title %> - <%= pkg.description %>\n' +
'* @version <%= pkg.version %>\n' +
'* @link <%= pkg.homepage %>\n' +
'* @copyright Steven Usher & Brad Vincent 2015\n' +
'* @license Released under the GPLv3 license.\n' +
'*/\n'
},
"build": {
"files": {
"./dist/css/foofields.min.css": "./dist/css/foofields.css"
}
}
},
"copy": {
"build": {
"expand": true,
"src": ["./src/css/img/*.png","./src/css/img/*.svg"],
"dest": "./dist/img",
"flatten": true
}
},
"jsdoc": {
"all": {
"src": [
"./readme.md","./dist/js/foofields.js"
],
"jsdoc": "./node_modules/jsdoc/jsdoc.js",
"options": {
"destination": "./docs/jsdocs",
"recurse": true,
"configure": "./jsdoc.json",
"template": "./node_modules/foodoc/template",
"tutorials": "./src/tutorials/"
}
}
}
});
// load required tasks
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks("grunt-contrib-concat");
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-contrib-cssmin");
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks("foo-utils");
grunt.loadNpmTasks("grunt-jsdoc");
// register build task for this project
grunt.registerTask("build", [
"clean:dist",
"foo-utils", // create the foofields.utils.js file that is then included as part of the core
"concat:build",
"uglify:build",
"cssmin:build",
"copy:build",
"clean:foo-utils" // remove the foofields.utils.js file as it is now part of foofields.core.js
]);
grunt.registerTask("docs", [
"build",
"clean:jsdoc",
"jsdoc:all"
]);
};