-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
41 lines (32 loc) · 1000 Bytes
/
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
module.exports = function(grunt) {
var buildConfig = grunt.file.readJSON('build.json');
// Concat config
var concatConfig = {
options: {
seperator: ';',
banner: '/* Version <%= concat.options.version %> */\n\n'
}
};
for(widget in buildConfig) {
concatConfig[widget] = {
files: buildConfig[widget].files
};
concatConfig.options.version = buildConfig[widget].version;
}
// qiwoobuild config
buildConfig.options = {
buildpath: 'build/qiwoo/',
root: 'module/'
};
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// 生成外链版
concat: concatConfig,
// 生成模块加载版
qiwoobuild: buildConfig,
module_transfer: buildConfig
});
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-qiwoobuild');
grunt.registerTask('default', ['concat', 'qiwoobuild']);
}