forked from bemky/mapbox-gl-draw-freehand-mode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
87 lines (78 loc) · 2.25 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
'use strict';
module.exports = function (grunt) {
// Load grunt tasks automatically, when needed
require('jit-grunt')(grunt, {
buildcontrol: 'grunt-build-control'
});
grunt.initConfig({
clean: {
demo: ['build']
},
copy: {
demo: {
files: {
'build/index.html': ['demo/index.html']
}
}
},
browserify: {
options: {
transform: [["babelify", { "presets": ["es2015"] }]],
alias: {
'@mapbox/mapbox-gl-draw-freehand-mode': './src/index.js'
}
},
demo: {
files: {
'build/index.js': ['demo/index.js']
},
options: {
watch: true
}
},
src: {
files: {
'dist/mapbox-gl-draw-freehand.js': ['src/index.js']
}
}
},
buildcontrol: {
options: {
dir: 'build',
commit: true,
push: true,
connectCommits: false,
message: 'Built live demo from commit %sourceCommit%'
},
demo: {
options: {
// Update the remote to point to your github repo
remote: '[email protected]:bemky/mapbox-gl-draw-freehand-mode.git',
branch: 'gh-pages',
}
}
},
connect: {
dev: {
options: {
base: 'build',
hostname: 'localhost',
port: 3000,
livereload: true
}
}
},
watch: {
dev: {
files: 'build/index.js',
options: {
livereload: true
}
}
}
});
grunt.registerTask('build', ['clean', 'copy', 'browserify']);
grunt.registerTask('serve', ['build', 'connect', 'watch']);
grunt.registerTask('deploy', ['build', 'buildcontrol']);
grunt.registerTask('default', ['serve']);
};