-
-
Notifications
You must be signed in to change notification settings - Fork 49
/
index.js
33 lines (25 loc) · 862 Bytes
/
index.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
'use strict';
var Bro = require('./lib/bro');
function framework(injector, bro) {
return injector.invoke(bro.framework);
}
function testFilePreprocessor(injector, bro) {
return injector.invoke(bro.testFilePreprocessor);
}
function bundlePreprocessor(injector, bro) {
return injector.invoke(bro.bundlePreprocessor);
}
module.exports = {
'bro': [ 'type', Bro ],
'framework:browserify': [ 'factory', framework ],
'preprocessor:browserify': [ 'factory', testFilePreprocessor ],
'preprocessor:browserify-bundle': [ 'factory', bundlePreprocessor ]
};
// override the default preprocess factory to add our
// preprocessor for *.browserify.js files
try {
module.exports.preprocess = [ 'factory', require('./lib/preprocessor').createPreprocessor ];
} catch (e) {
console.warn('failed to add custom browserify preprocessor');
console.warn(e);
}