-
Notifications
You must be signed in to change notification settings - Fork 1
/
gobblefile.js
60 lines (53 loc) · 1.42 KB
/
gobblefile.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
const gobble = require('gobble');
const browserify = require('./tools/gobble-browserify');
const mocha = require('./tools/gobble-mocha-shell');
const esdoc = require('./tools/gobble-esdoc-shell');
const eslint = require('./tools/gobble-eslint');
const replace = require('./tools/gobble-replace');
const pkg = gobble([
gobble('LICENSE'),
gobble('README.md'),
gobble('package.json').transform(function(input) {
const json = JSON.parse(input);
delete json.scripts;
delete json.devDependencies;
return JSON.stringify(json, null, ' ');
}),
gobble('src')
.observe(eslint)
.transform('babel', {})
.moveTo('lib')
.observe(mocha, {
files: 'lib/**/tests/*.js'
})
]).moveTo('pkg');
const starter = gobble('examples')
.exclude(['node_modules', 'dist', 'src/vulp.js', '.DS_Store'])
.transform(replace, {})
.moveTo('examples')
.transform('zip', {
dest: 'examples.zip'
});
const doc = gobble([
gobble('src').transform(esdoc, require('./esdoc.json')),
]).moveTo('docs');
const examples = gobble([
gobble([
gobble('src').moveTo('src'),
gobble('examples/src').moveTo('examples')
])
.transform('babel', {})
.transform(browserify, {
entries: 'examples/index.js',
dest: 'examples.js',
standalone: 'examples'
}),
gobble('examples/src')
.include(['**/*.html'])
]).moveTo('examples');
module.exports = gobble([
pkg,
examples,
doc,
starter
]);