This repository was archived by the owner on Mar 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgruntfile.js
109 lines (100 loc) · 3.53 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
module.exports = function (grunt) {
grunt.initConfig({
jsbeautifier: {
files : ["app/js/**/*.js"],
options : {
}
},
// define source files and their destinations
uglify: {
options: {
mangle: false,
compress: false,
beautify: false
},
files: {
files: {
'app/dist/js/min.js': [
'app/assets/jquery/dist/jquery.js',
'app/assets/aws-sdk/dist/aws-sdk.js',
'app/assets/ionic/release/js/ionic.js',
'app/assets/angular/angular.js',
'app/assets/angular-animate/angular-animate.js',
'app/assets/angular-sanitize/angular-sanitize.js',
'app/assets/angular-ui-router/release/angular-ui-router.js',
'app/assets/ionic/release/js/ionic-angular.js',
'app/assets/angular-resource/angular-resource.js',
'app/assets/ngstorage/ngStorage.js',
'app/assets/angular-gravatar/build/angular-gravatar.js',
'app/js/app.js',
'app/js/controllers.js',
'app/js/filters.js',
'app/js/services.js'
]
}
}
},
cssmin: {
combine: {
options: {
keepSpecialComments: 0
},
files: {
'app/dist/css/min.css': [
'app/assets/angular/angular-csp.css',
'app/assets/ionic/release/css/ionic.css',
'app/css/app.css'
]
}
}
},
copy: {
main: {
files: [
{expand: true, cwd: 'app/assets/ionic/release/fonts/', src: ['**'], dest: 'app/dist/fonts/'},
{expand: true, cwd: 'app/img/', src: ['**'], dest: 'app/dist/img/'},
{expand: true, src: ['icon.png'], dest: 'Locksmith.safariextension/'},
{expand: true, cwd: 'app/', src: ['index.html'], dest: 'Locksmith.safariextension/app/'},
{expand: true, cwd: 'app/dist/', src: ['**'], dest: 'Locksmith.safariextension/app/dist/'},
{expand: true, cwd: 'app/partials/', src: ['**'], dest: 'Locksmith.safariextension/app/partials/'}
]
}
},
zip: {
'locksmith.zip': [
'manifest.json',
'icon.png',
'app/dist/**',
'app/partials/**',
'app/index.html'
]
},
watch: {
uglify: {
files: [
'app/js/*.js',
'app/assets/**/*.js',
],
tasks: ['uglify'],
options: {interrupt: true}
},
cssmin: {
files: [
'app/css/*.css',
'app/assets/**/*.css',
],
tasks: ['cssmin'],
options: {interrupt: true}
}
}
});
// load plugins
grunt.loadNpmTasks('grunt-jsbeautifier');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-zip');
// register at least this one task
grunt.registerTask('default', [ 'jsbeautifier', 'uglify', 'cssmin', 'copy', 'zip' ]);
};