-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
97 lines (87 loc) · 1.84 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
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
less: {
js_css: {
files: {
"src/css/Waymark_Map.css": "src/less/Waymark_Map.less",
"src/css/Waymark_Map_Viewer.css": "src/less/Waymark_Map_Viewer.less",
"src/css/Waymark_Map_Editor.css": "src/less/Waymark_Map_Editor.less",
},
},
},
concat: {
js_js: {
src: [
"libs/js/leaflet.min.js",
"libs/js/*",
"src/js/Waymark_Map.js",
"src/js/Waymark_Map_Viewer.js",
"src/js/Waymark_Map_Editor.js",
"src/js/Waymark_Map_Factory.js",
],
dest: "dist/js/waymark-js.js",
},
js_css: {
src: ["libs/css/*.css", "src/css/*.css"],
dest: "dist/css/waymark-js.css",
},
},
terser: {
js_js: {
files: {
"dist/js/waymark-js.min.js": ["dist/js/waymark-js.js"],
},
},
},
cssmin: {
js_css: {
files: {
"dist/css/waymark-js.min.css": "dist/css/waymark-js.css",
},
},
},
copy: {
js: {
files: [
{
expand: true,
cwd: "dist/",
src: ["**"],
dest: "docs/public/dist/latest/",
},
],
},
},
watch: {
js_js: {
files: ["src/js/*.js"],
tasks: ["build_js_js", "copy:js"],
},
js_css: {
files: ["src/less/*.less"],
tasks: ["build_js_css", "copy:js"],
},
},
});
grunt.loadNpmTasks("grunt-terser");
grunt.loadNpmTasks("grunt-contrib-concat");
grunt.loadNpmTasks("grunt-contrib-cssmin");
grunt.loadNpmTasks("grunt-contrib-less");
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks("grunt-contrib-copy");
grunt.registerTask("default", [
"less",
"concat",
"terser",
"cssmin",
"copy",
"watch",
]);
grunt.registerTask("build_js_js", ["concat:js_js", "terser:js_js"]);
grunt.registerTask("build_js_css", [
"less:js_css",
"concat:js_css",
"cssmin:js_css",
]);
};