-
Notifications
You must be signed in to change notification settings - Fork 23
/
Gruntfile.js
93 lines (88 loc) · 2.88 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
/*global module:false*/
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
// Metadata.
meta: {
version: '0.1.0'
},
banner: '/*! enmodal - v<%= meta.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'* http://enmodal.co/\n' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> ' +
'Jason Wright; Licensed MIT */\n',
// Task configuration.
copy: {
main: {
files: [
{expand: true, flatten: true, src: ['src/js/enmodal/*.js'], dest: 'dist/js/', filter: 'isFile'},
{expand: true, flatten: true, src: ['src/js/lib/*.min.js'], dest: 'dist/js/', filter: 'isFile'},
{expand: true, flatten: true, src: ['src/css/*.css'], dest: 'dist/css/', filter: 'isFile'},
{expand: true, flatten: true, src: ['src/img/*'], dest: 'dist/img/', filter: 'isFile'},
{expand: true, flatten: true, src: ['src/*.html'], dest: 'dist/', filter: 'isFile'},
],
},
},
concat: {
options: {
banner: '<%= banner %>',
sourceMap: true,
stripBanners: true
},
dist: {
src: ['src/js/enmodal/main.js',
'src/js/enmodal/bezier.js',
'src/js/enmodal/data-layers.js',
'src/js/enmodal/components.js',
'src/js/enmodal/draw.js',
'src/js/enmodal/image.js',
'src/js/enmodal/interface.js',
'src/js/enmodal/markers.js',
'src/js/enmodal/session.js',
'src/js/enmodal/settings.js',
'src/js/enmodal/sharing.js',
'src/js/enmodal/sidebar.js',
'src/js/enmodal/station-pair.js',
'src/js/enmodal/transit.js',
'src/js/enmodal/utils.js'
],
dest: 'dist/js/enmodal.js'
}
},
uglify: {
options: {
banner: '<%= banner %>',
sourceMap: true,
sourceMapIncludeSources: true,
sourceMapIn: 'dist/js/enmodal.js.map'
},
dist: {
src: '<%= concat.dist.dest %>',
dest: 'dist/js/enmodal.min.js'
}
},
jshint: {
files: ['Gruntfile.js', 'src/js/enmodal/*.js'],
options: {
reporterOutput: "",
esnext: true,
globals: {
jQuery: true
}
}
},
watch: {
files: ['<%= jshint.files %>', 'src/*.html', 'src/css/*.css'],
tasks: ['copy', 'concat', 'uglify']
},
});
// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify-es');
grunt.loadNpmTasks('grunt-vue');
// Default task.
grunt.registerTask('default', ['copy', 'concat', 'uglify', 'jshint']);
};