-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathGruntfile.js
78 lines (76 loc) · 1.66 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
module.exports = function (grunt) {
require("load-grunt-tasks")(grunt);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
stripBanners: true,
banner: "#!/usr/bin/env node\n\nprocess.title = 'batch-transcode-video';\n\n",
},
bin: {
src: ['.tmp/batch-transcode-video.js'],
dest: 'bin/batch-transcode-video',
},
},
babel: {
options: {
sourceMap: true,
presets: ['env']
},
dist: {
files: [{
expand: true,
src: ['index.js', 'index-cli.js', 'lib/**/*.js'],
dest: 'dist/'
}]
},
bin: {
files: {
'.tmp/batch-transcode-video.js': 'batch-transcode-video.js'
}
}
},
watch: {
dist: {
files: ['index.js', 'index-cli.js', 'lib/**/*.js'],
tasks: ['babel:dist'],
options: {
spawn: false
}
},
standalone: {
files: ['batch-transcode-video.js'],
tasks: ['babel:bin', 'concat:bin', 'replace:bin'],
options: {
spawn: false
}
},
config: {
files: ['Gruntfile.js'],
tasks: [],
options: {
reload: true
}
}
},
replace: {
options: {
patterns: [
{
match: 'VERSION',
replacement: '<%= pkg.version %>'
}
]
},
bin: {
files: [{
expand: true,
cwd: 'bin/',
src: 'batch-transcode-video',
dest: 'bin/'
}]
}
}
});
grunt.registerTask('default', ['babel', 'concat', 'replace']);
};