-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathGruntfile.js
79 lines (68 loc) · 1.71 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
/* jshint node: true */
'use strict';
module.exports = function (grunt) {
var pkg = grunt.file.readJSON('package.json');
// Project configuration.
grunt.initConfig({
pkg: pkg,
bower: {
install: {
options: {
targetDir: 'dist/lib/'
}
}
},
copy: {
main: {
expand: true,
cwd: 'src/',
src: ['*.js', 'manifest.json'],
dest: 'dist/'
},
release: {
expand: true,
cwd: 'dist/',
src: ['**/*'],
dest: '<%= pkg.name %>-<%= pkg.version %>/'
}
},
jshint: {
all: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'],
options: {
jshintrc: true
}
},
jade: {
'dist/options.html': 'src/options.jade'
},
compress: {
main: {
options: {
archive: '<%= pkg.name %>-<%= pkg.version %>.zip'
},
files: [
{src: '<%= pkg.name %>-<%= pkg.version %>/**/*'}
]
}
}
});
// compression (e.g: zip) tasks
grunt.loadNpmTasks('grunt-contrib-compress');
// linting tasks
grunt.loadNpmTasks('grunt-contrib-jshint');
// jade tasks
grunt.loadNpmTasks('grunt-contrib-jade');
// bower task
grunt.loadNpmTasks('grunt-bower-task');
// copy taks
grunt.loadNpmTasks('grunt-contrib-copy');
// build task
grunt.registerTask('build', 'Builds the Content Script', ['bower:install',
'jade', 'copy:main']);
// release task
grunt.registerTask('release', 'Builds and makes a release of the Content ' +
'Script', ['build', 'copy:release', 'compress']);
// default task
grunt.registerTask('default', 'Runs all tasks necessary for development ' +
'and deployment', ['build', 'jshint']);
};