-
Notifications
You must be signed in to change notification settings - Fork 158
/
gobblefile.js
62 lines (54 loc) · 1.22 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
/*global require, module, __dirname */
var gobble = require( 'gobble' );
var babel = require( 'rollup-plugin-babel' );
var npm = require( 'rollup-plugin-npm' );
gobble.cwd( __dirname );
var lib = gobble([
gobble( 'src' ).transform( 'rollup', {
entry: 'ramjet.js',
dest: 'ramjet.umd.js',
format: 'umd',
moduleName: 'ramjet',
plugins: [ babel({ include: 'src/**' }), npm({ jsnext: true }) ],
sourceMap: true
}),
gobble( 'src' ).transform( 'rollup', {
entry: 'ramjet.js',
dest: 'ramjet.es6.js',
format: 'es6',
plugins: [ babel({ include: 'src/**' }), npm({ jsnext: true }) ],
sourceMap: true
})
]);
var demo = gobble([
gobble([ 'src', 'demo/app' ])
.transform( 'ractive', {
type: 'es6'
})
.transform( 'rollup', {
entry: 'main.js',
dest: 'app.js',
format: 'cjs',
plugins: [ babel({ include: 'src/**' }) ]
})
.transform( 'derequire' )
.transform( 'browserify', {
entries: [ './app' ],
dest: 'app.js',
standalone: 'app'
}),
gobble( 'demo/files' )
]);
var built;
if ( gobble.env() === 'production' ) {
built = gobble([
lib,
lib.include( 'ramjet.umd.js' ).transform( 'uglifyjs', { ext: '.min.js' })
]);
} else {
built = gobble([
demo,
lib
]);
}
module.exports = built;