forked from wangerzi/layui-excel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
52 lines (51 loc) · 1.28 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
module.exports = function (grunt) {
//项目配置
grunt.initConfig({
//读取配置项
pkg: grunt.file.readJSON('package.json'),
//执行具体任务 concat:合并 uglify:压缩
concat: {
//设置输出文件合并的字符
options: {
separator: "/*---------split--------*/"
},
dist: {
//被合并的文件的路径
src: [
"src/excel.js",
"src/Blob.js",
"src/FileSaver.js",
"src/jszip.js",
"src/xlsx.js",
"src/polyfill.js"
],
//被合成的文件路径
dest: "layui_exts/excel.js"
}
},
uglify: {
//注释
options: {
banner: "/* JeffreyWang压缩打包 <%= pkg.name %> <%= pkg.version %>*/ \n"
},
build: {
//被压缩的文件的路径
src: [
"src/excel.js",
"src/Blob.js",
"src/FileSaver.js",
"src/jszip.js",
"src/xlsx.js",
"src/polyfill.js"
],
//被压缩的文件路径
dest: "layui_exts/excel.min.js"
}
},
})
//加载合并插件
grunt.loadNpmTasks("grunt-contrib-concat")
grunt.loadNpmTasks("grunt-contrib-uglify")
//执行任务
grunt.registerTask("default", ["concat", "uglify"])
}