-
Notifications
You must be signed in to change notification settings - Fork 107
/
Gruntfile.js
54 lines (47 loc) · 1.79 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
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
meta: {
banner: '/*!<%= "\\n" %>' +
' * <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") + "\\n" %>' +
'<%= pkg.homepage ? " * " + pkg.homepage + "\\n" : "" %>' +
' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %><%= "\\n" %>' +
' * Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %>' +
' (<%= _.pluck(pkg.licenses, "url").join(", ") %>)<%= "\\n" %>' +
'*/' +
'<%= "\\n\\n" %>'
},
uglify: {
all: {
files: {
'src/jquery.jcarousellite.min.js': ['src/jquery.jcarousellite.js']
}
},
options: {
preserveComments: false,
banner: '<%= meta.banner %>',
compress: {
drop_console: true
}
}
},
compress: {
main: {
options: {
archive: 'jcarousellite-demo.zip'
},
files: [{
expand: true, // Set this to enable CWD below
cwd: 'demo/', // Change directory to demo/
src: ['**/*'], // Take all files and folders and sub-folders from the CWD
dest: '/' // Create ZIP file in /
}]
}
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.registerTask('build', ['uglify']);
grunt.registerTask('demo', ['compress']);
};