forked from Rich-Harris/ramjet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gobblefile.js
66 lines (59 loc) · 1.14 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
61
62
63
64
65
66
var gobble = require( 'gobble' );
gobble.cwd( __dirname );
var babelWhitelist = [
'es6.arrowFunctions',
'es6.blockScoping',
'es6.classes',
'es6.constants',
'es6.destructuring',
'es6.parameters.default',
'es6.parameters.rest',
'es6.properties.shorthand',
'es6.templateLiterals'
];
var lib = gobble( 'src' )
.transform( 'babel', {
whitelist: babelWhitelist,
sourceMap: false
})
.transform( 'esperanto-bundle', {
entry: 'ramjet',
type: 'umd',
name: 'ramjet',
sourceMap: false
});
var demo = gobble([
gobble([ 'src', 'demo/app' ])
.transform( 'ractive', {
type: 'es6'
})
.transform( 'babel', {
whitelist: babelWhitelist,
inputSourceMap: false
})
.transform( 'esperanto-bundle', {
entry: 'main',
dest: 'app.js',
type: 'cjs'
})
.transform( 'derequire' )
.transform( 'browserify', {
entries: [ './app' ],
dest: 'app.js',
standalone: 'app'
}),
gobble( 'demo/files' )
]);
if ( gobble.env() === 'production' ) {
built = gobble([
demo.transform( 'uglifyjs' ),
lib,
lib.transform( 'uglifyjs', { ext: '.min.js' })
]);
} else {
built = gobble([
demo,
lib
]);
}
module.exports = built;