-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
143 lines (125 loc) · 3.4 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
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
138
139
140
141
142
143
module.exports = function (grunt) {
function readOptionalJSON(filepath) {
var stripJSONComments = require("strip-json-comments"),
data = {};
try {
data = JSON.parse(stripJSONComments(
fs.readFileSync(filepath, {
encoding: "utf8"
})
));
} catch (e) {}
return data;
}
grunt.initConfig({
build: {
es6: {
globals: grunt.file.read("src/helpers/global.js"),
wrapper: grunt.file.read("src/helpers/wrapper_es6.js"),
dest: "src/libs/jquery.es6.js",
srcFolder: __dirname + '/node_modules/jquery/src',
minimum: [
"core",
"selector"
],
rjsconfig: {
generateSourceMaps: false,
optimize: "none",
},
// Exclude specified modules if the module matching the key is removed
removeWith: {
ajax: ["manipulation/_evalUrl", "event/ajax"],
callbacks: ["deferred"],
css: ["effects", "dimensions", "offset"],
"css/showHide": ["effects"],
deferred: {
remove: ["ajax", "effects", "queue", "core/ready"],
include: ["core/ready-no-deferred"]
},
sizzle: ["css/hiddenVisibleSelectors", "effects/animatedSelector"]
}
},
full: {
globals: grunt.file.read("src/helpers/global.js"),
wrapper: grunt.file.read("src/helpers/wrapper_amd.js"),
dest: "dist/jquery.js",
srcFolder: __dirname + '/src/jquery_shim',
minimum: [
"core",
"selector"
],
rjsconfig: {
generateSourceMaps: false,
optimize: "uglify",
uglify: {
//Example of a specialized config. If you are fine
//with the default options, no need to specify
//any of these properties.
output: {
beautify: true
},
mangle: false,
width: 300
}
},
// Exclude specified modules if the module matching the key is removed
removeWith: {
ajax: ["manipulation/_evalUrl", "event/ajax"],
callbacks: ["deferred"],
css: ["effects", "dimensions", "offset"],
"css/showHide": ["effects"],
deferred: {
remove: ["ajax", "effects", "queue", "core/ready"],
include: ["core/ready-no-deferred"]
},
sizzle: ["css/hiddenVisibleSelectors", "effects/animatedSelector"]
}
},
min: {
globals: grunt.file.read("src/helpers/global.js"),
wrapper: grunt.file.read("src/helpers/wrapper_amd.js"),
dest: "dist/jquery.min.js",
srcFolder: __dirname + '/src/jquery_shim',
minimum: [
"core",
"selector"
],
rjsconfig: {
generateSourceMaps: true,
preserveLicenseComments: false,
optimize: "uglify",
uglify: {
mangle: true,
screw_ie8: true,
stats: true,
lint: true,
verbose: true,
compress: {
dead_code: true,
unused: true,
join_vars: true
},
output: {
beautify: false
}
}
},
// Exclude specified modules if the module matching the key is removed
removeWith: {
ajax: ["manipulation/_evalUrl", "event/ajax"],
callbacks: ["deferred"],
css: ["effects", "dimensions", "offset"],
"css/showHide": ["effects"],
deferred: {
remove: ["ajax", "effects", "queue", "core/ready"],
include: ["core/ready-no-deferred"]
},
sizzle: ["css/hiddenVisibleSelectors", "effects/animatedSelector"]
}
}
}
});
grunt.loadTasks('grunt_tasks');
grunt.registerTask('concates6', ['concat:hammer', 'concat:material']);
grunt.registerTask('publish', ['concates6', 'jspmbuild']);
};