-
Notifications
You must be signed in to change notification settings - Fork 95
/
Gruntfile.js
49 lines (44 loc) · 1.3 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
module.exports = function(grunt) {
var pkg = grunt.file.readJSON('package.json');
grunt.initConfig({
pkg: pkg,
download: {
options: {
dest: 'dist'
},
debug: {
options: {
transform: function(code) {
return [
'define("gallery/raphael/'+pkg.version+'/raphael-debug", [], function() {',
'var define;',
code,
"return window.Raphael;",
"});"
].join('\n');
}
},
url: 'https://raw.github.com/DmitryBaranovskiy/raphael/v<%= pkg.version %>/raphael.js',
name: 'raphael-debug.js'
},
min: {
options: {
transform: function(code) {
return [
'define("gallery/raphael/'+pkg.version+'/raphael", [], function() {',
'var define;',
code,
"return window.Raphael;",
"});"
].join('\n');
}
},
url: 'https://raw.github.com/DmitryBaranovskiy/raphael/v<%= pkg.version %>/raphael-min.js',
name: 'raphael.js'
}
}
});
grunt.loadTasks('../_tasks/download/tasks');
grunt.registerTask('build', ['download']);
};
/** 只需 grunt, 直接下载到 dist 目录, 不需要再 spm build **/