-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathGruntfile.js
More file actions
45 lines (43 loc) · 1.7 KB
/
Copy pathGruntfile.js
File metadata and controls
45 lines (43 loc) · 1.7 KB
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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON( 'package.json' ),
manifest: grunt.file.readJSON( './src/manifest.json' ),
crx: {
staging: {
"src": "./src/",
"dest": "./dist/staging/crx/<%= pkg.name %>-<%= manifest.version %>.crx",
"exclude": [ ".md", ".gitignore", ".git", ".svn", "dist", ".pem", "Gruntfile.js", "package.json", "node_modules" ],
"privateKey": "./build.pem"
},
production: {
"src": "./src/",
"dest": "./dist/production/crx/<%= pkg.name %>-<%= manifest.version %>.crx",
"exclude": [ ".md", ".gitignore", ".git", ".svn", "dist", ".pem", "Gruntfile.js", "package.json", "node_modules" ],
"privateKey": "./build.pem"
}
},
compress: {
staging: {
options: {
archive: "./dist/staging/zip/<%= pkg.name %>-<%= manifest.version %>.zip",
},
cwd: './src',
src: [ '**' ],
expand: true
},
production: {
options: {
archive: "./dist/production/zip/<%= pkg.name %>-<%= manifest.version %>.zip",
},
cwd: './src',
src: [ '**' ],
expand: true
}
}
});
grunt.loadNpmTasks( 'grunt-crx' );
grunt.loadNpmTasks( 'grunt-contrib-compress' );
grunt.registerTask( 'package', [ 'crx:production', 'compress:production' ] );
grunt.registerTask( 'default', [ 'crx:staging', 'compress:staging'] );
};