-
Notifications
You must be signed in to change notification settings - Fork 71
/
Gruntfile.js
72 lines (65 loc) · 2.15 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
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
browserify: {
options: {
transform: ['coffeeify'],
browserifyOptions: {
extensions: ['.coffee']
}
},
safari: {
files: {
'LiveReload.safariextension/global.js': ['src/safari/global.coffee'],
'LiveReload.safariextension/injected.js': ['src/safari/injected.coffee'],
'LiveReload.safariextension/livereload.js': ['src/livereload-js.coffee']
}
},
chrome: {
files: {
'Chrome/LiveReload/global.js': ['src/chrome/global.coffee'],
'Chrome/LiveReload/injected.js': ['src/chrome/injected.coffee'],
'Chrome/LiveReload/devtools.js': ['src/chrome/devtools.coffee'],
'Chrome/LiveReload/livereload.js': ['src/livereload-js.coffee']
}
},
firefox: {
files: {
'Firefox/content/firefox.js': ['src/firefox/firefox.coffee'],
'Firefox/content/livereload.js': ['src/livereload-js.coffee']
}
}
},
compress: {
options: {
pretty: true,
level: 9,
},
chrome: {
options: {
archive: 'dist/<%= pkg.version %>/LiveReload-<%= pkg.version %>-ChromeWebStore.zip'
},
files: [
{ expand: true, cwd: 'Chrome/LiveReload', src: ['**.{json,js,html,png}'], dest: 'LiveReload/' }
]
},
firefox: {
options: {
archive: 'dist/<%= pkg.version %>/LiveReload-<%= pkg.version %>.xpi',
mode: 'zip'
},
files: [
{ expand: true, cwd: 'Firefox', src: ['**/*.{js,xul,manifest,rdf,png}'], dest: '/' }
]
}
}
});
grunt.loadNpmTasks('grunt-contrib-coffee');
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.registerTask('build', ['browserify']);
grunt.registerTask('default', ['build']);
grunt.registerTask('chrome', ['browserify:chrome', 'compress:chrome']);
grunt.registerTask('firefox', ['browserify:firefox', 'compress:firefox']);
grunt.registerTask('all', ['chrome', 'firefox']);
};