forked from ableplayer/ableplayer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
107 lines (103 loc) · 3.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks("grunt-remove-logging");
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
build: {
src: [
// Ultimately this should be just 'scripts/*.js',
// but for now we're maintaining the order which was
// specified in the previous 'compile.sh' script
'scripts/ableplayer-base.js',
'scripts/initialize.js',
'scripts/preference.js',
'scripts/webvtt.js',
'scripts/buildplayer.js',
'scripts/track.js',
'scripts/youtube.js',
'scripts/slider.js',
'scripts/volume.js',
'scripts/dialog.js',
'scripts/misc.js',
'scripts/description.js',
'scripts/browser.js',
'scripts/control.js',
'scripts/caption.js',
'scripts/chapters.js',
'scripts/metadata.js',
'scripts/transcript.js',
'scripts/search.js',
'scripts/event.js',
'scripts/dragdrop.js',
'scripts/sign.js',
'scripts/langs.js',
'scripts/translation.js',
'scripts/ttml2webvtt.js',
'scripts/JQuery.doWhen.js',
'scripts/vts.js'
],
dest: 'build/<%= pkg.name %>.js'
},
},
removelogging: {
dist: {
src: [
'build/<%= pkg.name %>.js'
],
dest: 'build/<%= pkg.name %>.dist.js'
},
options: {
// Remove all console output (see https://www.npmjs.com/package/grunt-remove-logging)
}
},
uglify: {
min: {
src : ['build/<%= pkg.name %>.dist.js'],
dest : 'build/<%= pkg.name %>.min.js',
},
options: {
// Add a banner with the package name and version
// (no date, otherwise a new build is different even if the code didn't change!)
banner: '/*! <%= pkg.name %> V<%= pkg.version %> */\n',
// Preserve comments that start with a bang (like the file header)
preserveComments: "some"
}
},
cssmin: {
min: {
src : [
'styles/ableplayer.css',
],
dest : 'build/<%= pkg.name %>.min.css',
},
options: {
// Add a banner with the package name and version
// (no date, otherwise a new build is different even if the code didn't change!)
// (oddly, here we don't need a '\n' at the end!)
banner: '/*! <%= pkg.name %> V<%= pkg.version %> */',
}
},
jshint: {
files: ['Gruntfile.js', 'scripts/**/*.js'],
options: {
// options here to override JSHint defaults
globals: {
browser: true,
jquery: true,
devel: true,
}
}
},
clean: {
build: ['build'],
},
});
grunt.registerTask('default', ['concat', 'removelogging', 'uglify', 'cssmin']);
grunt.registerTask('test', ['jshint']);
};