forked from jpvantuyl/ChromeKeePass
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
111 lines (106 loc) · 3.98 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
108
109
110
111
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('manifest.json'),
clean: ['build', '<%= pkg.name %>.zip'],
uglify: {
options: {
banner: '/*! <%= pkg.name %>, '
+ 'Copyright <%= grunt.template.today("yyyy") %> Steven Campbell\n'
+ '*/\n',
mangle: false,
preserveComments: 'some'
},
target: {
files: [
{expand: true, src: 'popups/**/*.js', dest:'build/'},
{expand: true, src: 'background/**/*.js', dest:'build/'},
{expand: true, src: 'services/**/*.js', dest:'build/'},
{expand: true, src: 'options/**/*.js', dest:'build/'},
{expand: true, src: ['*.js', '!Gruntfile.js', '!tests/*', '!bower_components/**/*'], dest:'build/'}
]
}
},
copy: {
bower: {
files: [
{expand: true, cwd: 'bower_components/Case/dist/', src: 'case.min.js', dest: 'lib/'},
{expand: true, cwd: 'bower_components/json-formatter/dist/', src: 'json-formatter.min.js', dest: 'lib/'},
{expand: true, cwd: 'bower_components/json-formatter/dist/', src: 'json-formatter.min.css', dest: 'lib/'},
{expand: true, cwd: 'bower_components/angular/', src: 'angular.min.css', dest: 'lib/'},
{expand: true, cwd: 'bower_components/angular/', src: 'angular-csp.css', dest: 'lib/'},
{expand: true, cwd: 'bower_components/angular-animate/', src: 'angular-animate.min.js', dest: 'lib/'},
{expand: true, cwd: 'bower_components/angular-route/', src: 'angular-route.min.js', dest: 'lib/'},
{expand: true, cwd: 'bower_components/angular-sanitize/', src: 'angular-sanitize.min.js', dest: 'lib/'},
{expand: true, cwd: 'bower_components/animate.css/', src: 'animate.css', dest: 'lib/'}
]
}
},
less: {
target: {
options: {
ieCompat: false,
banner: '/*! <%= pkg.name %>, '
+ 'Copyright <%= grunt.template.today("yyyy") %> Steven Campbell\n'
+ ' This file is generated.\n'
+ '*/\n',
},
files: {
"popups/popup.css": "popups/popup.less",
"options/options.css": "options/options.less"
}
}
},
cssmin: {
target: {
files: [
{expand: true, src: 'popups/**/*.css', dest:'build/'},
{expand: true, src: 'options/**/*.css', dest:'build/'},
{expand: true, src: 'lib/**/*.css', dest:'build/'},
{expand: true, src: '*.css', dest:'build/'}
]
}
},
htmlmin: {
options: {
},
files: {expand: true, src: ['**/*.html', '!node_modules/**/*.html', '!tests/**/*', '!bower_components/**/*'], dest: 'build/'}
},
compress: {
options: {
archive: "<%= pkg.name %>.zip"
},
target: {
files: [
{expand: true, cwd: 'build/', src: '**/*', dest:'/'},
{expand: true, src: 'lib/*.js', dest: '/'},
{expand: true, src: 'manifest.json', dest: '/'},
{expand: true, src: 'license.txt', dest: '/'},
{expand: true, src: 'assets/**/*', dest: '/'}
]
}
},
watch: {
less: {
files: ['**/*.less', '!/bower_components/**/*'],
tasks: ['less'],
options: {
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-htmlmin');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-less');
// Default task(s).
grunt.registerTask('default', ['clean']);
grunt.registerTask('package', ['clean', 'copy:bower', 'uglify', 'less', 'cssmin', 'htmlmin', 'compress']);
grunt.registerTask('updatelib', ['copy:bower']);
//grunt.registerTask('styles', ['watch']);
};