-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgruntfile.js
98 lines (91 loc) · 2.55 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
module.exports = function (grunt) {
require("matchdep").filterDev("grunt-*").forEach(grunt.loadNpmTasks);
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
dist: {
options: {
style: 'expanded',
sourcemap: false,
noCache: true
},
files: {
'dist/css/map3.css': 'src/scss/main.scss',
}
}
},
copy: {
main: {
files: [{
cwd: './test',
src: '**/*',
dest: 'dist/test',
expand: true
}
]
}
},
connect: {
server: {
options: {
hostname: '0.0.0.0',
port: 8888,
base: "dist",
livereload: true
}
}
},
open: {
all: {
path: 'http://localhost:8888/test'
}
},
concat: {
options: {
// define a string to put between each file in the concatenated output
separator: ';\n'
},
libs: {
src: [
'src/vendors/jquery/dist/jquery.min.js',
'src/vendors/d3/d3.min.js',
'src/vendors/d3plus/d3plus.min.js',
'src/js/d3.selectable.js',
'src/js/map3.js'
],
dest: 'dist/js/map3.full.js'
}
},
uglify: {
options: {
mangle: false,
sourceMap: false
},
build: {
files: {
'dist/js/map3.min.js': ['src/js/map3.js']
}
}
},
watch: {
main: {
options: {
livereload: true
},
files: ['src/**/*', 'test/**/*'],
tasks: ['default']
},
test: {
options: {
livereload: true
},
files: ['test/**/*'],
tasks: ['default', 'copy']
}
},
});
// Default task.
grunt.registerTask('default', ['uglify', 'concat', 'sass']);
grunt.registerTask('serve', ['default', 'copy', "open", 'connect:server', 'watch']);
};