forked from huiyan-fe/mapv
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.js
More file actions
53 lines (51 loc) · 1.49 KB
/
Copy pathGruntfile.js
File metadata and controls
53 lines (51 loc) · 1.49 KB
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
module.exports = function(grunt) {
//配置参数
grunt.initConfig({
name: 'Mapv',
version: '1.0.0',
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
separator: ';',
stripBanners: true
},
dist: {
src: [
"src/start.js",
"src/common/util.js",
"src/common/MVCObject.js",
"src/common/Class.js",
"src/Mapv.js",
"src/layer/*.js",
"src/data/*.js",
"src/control/*.js",
"src/Drawer/Drawer.js",
"src/Drawer/*.js",
"src/end.js",
],
dest: "dist/Mapv.js"
}
},
uglify: {
options: {
},
dist: {
files: {
'dist/Mapv.min.js': 'dist/Mapv.js'
}
}
},
watch: {
js: {
files: ['src/*.js', 'src/**/*.js'],
tasks: ['concat', 'uglify']
}
}
});
//载入concat和uglify插件,分别对于合并和压缩
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
//注册任务
grunt.registerTask('default', ['concat', 'uglify', 'watch']);
}