-
Notifications
You must be signed in to change notification settings - Fork 7
/
Gruntfile.js
102 lines (100 loc) · 2.65 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
module.exports = function(grunt) {
grunt.initConfig({
clean: ['dist/'],
browserify: {
background: {
src: ['src/lib/sonos.js', 'src/js/background.js'],
dest: 'dist/js/background.js',
options: {
alias: ['./src/lib/sonos.js:sonos']
}
},
app: {
src: ['src/lib/sonos.js', 'src/page_action/page_action.js'],
dest: 'dist/js/app.js',
options: {
alias: ['./src/lib/sonos.js:sonos']
}
},
content_sc: {
src: ['src/lib/mutation-summary.js', 'src/content_script/sc/content.js'],
dest: 'dist/js/sc/content.js',
options: {
alias: ['./src/lib/mutation-summary.js:mutation-summary']
}
},
content_sc_widget: {
src: ['src/lib/mutation-summary.js', 'src/content_script/sc/widget.js'],
dest: 'dist/js/sc/widget.js',
options: {
alias: ['./src/lib/mutation-summary.js:mutation-summary']
}
},
content_ht: {
src: ['src/lib/mutation-summary.js', 'src/content_script/ht/content.js'],
dest: 'dist/js/ht/content.js',
options: {
alias: ['./src/lib/mutation-summary.js:mutation-summary']
}
}
},
copy: {
manifest: {
src: 'src/manifest.json',
dest: 'dist/manifest.json'
},
icons: {
expand: true,
src: 'src/icons/*.png',
dest: 'dist/icons/',
flatten: true,
filter: 'isFile'
},
css: {
expand: true,
cwd: 'src/css',
src: '**',
dest: 'dist/css/',
flatten: false,
filter: 'isFile'
},
content_script: {
expand: true,
src: 'src/content_script/*.gif',
dest: 'dist/content_script/',
flatten: true,
filter: 'isFile'
},
page_action: {
expand: true,
src: 'src/page_action/**',
dest: 'dist/page_action/',
flatten: true,
filter: 'isFile'
},
settings: {
expand: true,
src: 'src/settings/**',
dest: 'dist/settings/',
flatten: true,
filter: 'isFile'
}
},
compress: {
main: {
options: {
archive: 'add-to-sonos-queue.zip'
},
files: [
{expand: true, src: ['**/*'], dest: '/', cwd: 'dist/'}
]
}
}
});
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.registerTask('default', ['clean', 'browserify', 'copy']);
grunt.registerTask('pack', ['default', 'compress']);
};