forked from futurepress/epub.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
92 lines (84 loc) · 2.83 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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: '<json:package.json>',
meta: {
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %> */'
},
concat_sourcemap : {
'build/epub_no_underscore.js': ['<banner>', 'libs/rsvp/rsvp.js', 'src/*.js'],
'build/epub.js': ['<banner>', 'libs/underscore/underscore-min.js', 'libs/rsvp/rsvp.js', 'src/*.js'],
'build/reader.js': ['<banner>', 'reader_src/reader.js', 'reader_src/controllers/*.js'],
'build/hooks.js': ['<banner>', 'hooks/default/*.js']
},
uglify: {
my_target: {
options: {
preserveComments: 'some',
sourceMap: true
},
files: {
'build/epub.min.js': ['build/epub.js'],
'build/reader.min.js': ['build/reader.js'],
'build/hooks.min.js': ['build/hooks.js'],
'build/libs/zip.min.js': ['libs/zip/zip.js', 'libs/zip/zip-fs.js', 'libs/zip/zip-ext.js', 'libs/zip/mime-types.js'],
'build/libs/inflate.js': ['libs/zip/inflate.js']
}
}
},
copy: {
main: {
files: [
{src: 'build/epub.js', dest: 'reader/js/epub.min.js'},
{src: 'build/hooks.min.js', dest: 'reader/js/hooks.min.js'},
{src: 'build/reader.min.js', dest: 'reader/js/reader.min.js'},
{src: 'build/epub.min.map', dest: 'reader/js/epub.js.map'},
{src: 'build/hooks.min.map', dest: 'reader/js/hooks.js.map'},
{src: 'build/reader.js.map', dest: 'reader/js/hooks.js.map'},
{src: 'build/zip/*', dest: 'reader/js/libs/', filter: 'isFile'},
{src: 'libs/jquery/jquery-2.1.0.min.js', dest:'reader/js/libs/jquery-2.1.0.min.js'},
{src: 'libs/screenfull.min.js', dest: 'reader/js/libs/screenfull.min.js'},
{src: 'reader_src/plugins/search.js', dest: 'reader/js/plugins/search.js'},
{src: 'reader_src/plugins/hypothesis.js', dest: 'reader/js/plugins/hypothesis.js'},
{src: 'hooks/extensions/highlight.js', dest: 'reader/js/hooks/extensions/highlight.js'}
]
},
},
jshint: {
all: ['src/**/*.js'],//, 'reader/**/*.js']
options : {
// Environments
"browser": true,
"devel": true,
"worker": true,
// Enforcing
//"maxlen": 80,
//"quotmark": "single",
"trailing": true,
"strict": false,
// Relaxing
"boss": true,
"funcscope": true,
"globalstrict": true,
"loopfunc": true,
"maxerr": 1000,
"nonstandard": true,
"sub": true,
"validthis": true,
"globals": {
"_": false,
"define" : false,
"module" : false
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-concat-sourcemap');
grunt.loadNpmTasks('grunt-contrib-copy');
// Default task(s).
grunt.registerTask('default', ['jshint', 'concat_sourcemap', 'uglify', 'copy']);
};