-
Notifications
You must be signed in to change notification settings - Fork 40
/
Gruntfile.js
30 lines (28 loc) · 996 Bytes
/
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
module.exports = function(grunt) {
const target = grunt.option('target');
grunt.initConfig({
compress: {
main: {
options: {
archive: `foxyproxy-${target}.zip`
},
files: [
{expand: true, cwd: 'src/', src: ['**/*', '!.DS_Store', '!manifest-*', '!*.zip', '!screenshots/**'], dest: '/', filter: 'isFile'}
]
}
}
});
if (!target) {
grunt.fail.fatal('--target command-line arg expected to be one of: chrome-standard, chrome-basic, firefox-standard, firefox-basic. Example: grunt --target=chrome-standard');
}
let manifestSuffix = target;
if (target === 'chrome-standard') {
manifestSuffix = 'chrome';
}
else if (target === 'firefox-standard') {
manifestSuffix = 'firefox';
}
grunt.file.copy(`src/manifest-${manifestSuffix}.json`, 'src/manifest.json');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.registerTask('default', ['compress']);
};