-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
91 lines (82 loc) · 2.2 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
/**
* @license MIT http://troopjs.mit-license.org/
*/
/*globals module:false*/
/*eslint no-multi-str:0*/
module.exports = function (grunt) {
"use strict";
// Configure grunt
grunt.initConfig({
"pkg": grunt.file.readJSON("bower.json"),
"build": {
"src": ".",
"dist": "dist",
"footer": "\
define(['troopjs-widget/version'], function (version) {\n\
return version;\n\
});"
},
"requirejs": {
"options": {
"mainConfigFile": "require.js",
"appDir": "<%= build.src %>",
"dir": "<%= build.dist %>",
"optimize": "none",
"optimizeCss": "none",
"skipDirOptimize": true,
"keepBuildDir": true,
"fileExclusionRegExp": /^(?:\.(?!gitignore)|node_modules|test|guides|(?:version|require|Gruntfile)\.js|package\.json)/,
"rawText": {
"troopjs-widget/version": "define([], { 'toString': function () { return <%= JSON.stringify(pkg.version) %>; } });\n"
},
"wrap": {
"end": "<%= build.footer %>"
}
},
"bundles": {
"options": {
"modules": [ {
"name": "troopjs-widget/main",
"exclude": [
"jquery",
"when/when",
"troopjs-core/component/signal/start",
"troopjs-core/component/signal/finalize",
"troopjs-dom/component"
],
"excludeShallow": [
"troopjs-widget/main"
]
} ]
}
}
},
"clean": {
"dist": [ "<%= build.dist %>" ]
},
"uglify": {
"options": {
"report": "min",
"preserveComments": false
},
"bundles": {
"files": [ {
"expand": true,
"dest": "<%= build.dist %>",
"cwd": "<%= build.dist %>",
"src": [ "main.js" ],
"ext": ".min.js"
} ]
}
},
"buster": {
"bundles": {}
}
});
// Load all grunt tasks from package.json
require("load-grunt-tasks")(grunt);
grunt.registerTask("compile", [ "requirejs" ]);
grunt.registerTask("compress", [ "uglify" ]);
grunt.registerTask("test", [ "buster" ]);
grunt.registerTask("default", [ "compile", "compress" ]);
};