-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
87 lines (82 loc) · 2.51 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
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %> */',
concat_in_order: {
options: {
banner: '<%= banner %>\n',
stripBanners: true,
separator: ';'
},
basic: {
src: ['src/commonFunctions.js',
'src/pageSetup.js',
'src/editPolygon.js',
'src/drawPolygon.js',
// 'src/mugshots.js',
'src/gridOverlay.js',
'src/mapMarker.js',
'src/ruler.js',
'src/blender.js',
'src/markupTools.js',
'src/draggable.js',
'src/filterPopup.js',
'src/filters.js',
'src/ImageViewer.js',
'src/layerUI.js',
'src/layerPopup.js',
'src/synchronizeViewers.js'],
dest: 'dist/<%= pkg.name %>.js'
},
extras: {
src: ['vendor/openseadragon/openseadragon.min.js',
'vendor/OpenseadragonFabricjsOverlay/openseadragon-fabricjs-overlay.js',
'vendor/jquery.min.js',
// Dependency required in fabric.js does not exist: jsdom
// Dependency required in openseadragon-filtering.js does not exist: openseadragon
'vendor/OpenSeadragonScalebar/openseadragon-scalebar.js',
'vendor/color-picker/index.min.js'],
dest: 'dist/vendor.min.js'
}
},
uglify: {
options: {
banner: '<%= banner %>',
stripBanners: true
},
build: {
src: 'dist/<%= pkg.name %>.js',
dest: 'dist/<%= pkg.name %>.min.js'
}
},
cssmin: {
target: {
files: {
'dist/main.min.css': ['css/main.css', 'vendor/color-picker/index.css']
// vendor/fontawesome needs to stay put
}
}
},
copy: {
main: {
files: [
{
expand: true,
cwd: 'dist/', // set the current working directory
src: 'main.min.css', // what files to copy
dest: 'css/' // where to put the copied files
}
]
}
}
});
// Load npm plugins to provide necessary tasks.
grunt.loadNpmTasks('grunt-concat-in-order');
grunt.loadNpmTasks('grunt-contrib-uglify-es');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-copy');
// Register tasks
grunt.registerTask('default', ['concat_in_order', 'uglify', 'cssmin', 'copy']);
}