Repository navigation
Expand file tree
/
Copy pathgobblefile.js
More file actions
84 lines (70 loc) · 1.76 KB
/
Copy pathgobblefile.js
File metadata and controls
84 lines (70 loc) · 1.76 KB
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
79
80
81
82
83
84
var gobble = require( 'gobble' );
var spelunk = require( 'spelunk' );
var shared = gobble( 'node_modules/ractive-www' );
var components = gobble([ shared.grab( 'components' ), 'src/components' ]);
var plugins = spelunk.sync( 'src/plugins' );
module.exports = gobble([
// index page
components
.transform( 'ractive-render', {
component: 'Index.html',
files: {
'index.html': {
title: 'Plugins | Ractive.js',
plugins: plugins
}
}
}),
// plugin pages
components
.transform( 'ractive-render', {
component: 'PluginPage.html',
files: (function () {
var pages = {};
Object.keys( plugins ).forEach( function ( categoryName ) {
var category = plugins[ categoryName ];
Object.keys( category ).forEach( function ( pluginName ) {
var plugin = category[ pluginName ];
plugin.name = pluginName;
plugin.title = pluginName + ' | Plugins | Ractive.js';
pages[ pluginName + '.html' ] = plugin;
});
});
return pages;
}())
}),
// styles
gobble([ shared.grab( 'scss' ).moveTo( 'shared' ), 'src/scss' ])
.transform( 'sass', { src: 'main.scss', dest: 'main.css' }),
// files
shared.grab( 'assets' ).moveTo( 'assets' ),
// app
gobble([
'src/app',
components.transform( 'ractive', { type: 'es6' })
])
.transform( 'babel', {
whitelist: [
'es6.arrowFunctions',
'es6.blockScoping',
'es6.classes',
'es6.constants',
'es6.destructuring',
'es6.parameters.default',
'es6.parameters.rest',
'es6.properties.computed',
'es6.spread',
'es6.templateLiterals'
]
})
.transform( 'esperanto-bundle', {
entry: 'main',
type: 'cjs'
})
.transform( 'derequire' )
.transform( 'browserify', {
entries: [ './main' ],
dest: 'app.js',
debug: true
})
]);