-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathGruntfile.js
31 lines (25 loc) · 1.22 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
module.exports = function (grunt) {
// Load the plugins
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks("grunt-contrib-coffee");
grunt.loadNpmTasks("grunt-contrib-compass");
grunt.loadNpmTasks("grunt-contrib-cssmin");
grunt.loadNpmTasks("grunt-contrib-copy");
grunt.loadNpmTasks("grunt-text-replace");
grunt.loadNpmTasks("grunt-contrib-handlebars");
// Load the various task configuration files
var configs = require("load-grunt-configs")(grunt);
grunt.initConfig(configs);
grunt.registerTask("editmanifestforfirefox", function() {
var manifest = grunt.file.readJSON("./src/manifest.json");
// On Firefox, with Manifest V3, we use "background" files and not service workers
manifest.background.scripts =["js/lib/jquery.min.js", "js/shared.js", "js/background.js"]
delete manifest.background.service_worker;
// On Firefox, with Manifest V3, we have to sign the extension with our unique ID
manifest.browser_specific_settings = { "gecko": { "id": "firefox@hunter.io" } };
grunt.file.write("./build-firefox/manifest.json", JSON.stringify(manifest, null, 2));
grunt.log.writeln("Manifest updated for Firefox");
});
// Default task
grunt.registerTask("default", ["watch"]);
}