-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.js
More file actions
30 lines (25 loc) · 760 Bytes
/
index.js
File metadata and controls
30 lines (25 loc) · 760 Bytes
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
/*jslint node: true, nomen: true */
'use strict';
var path = require('path'),
merge = require('merge-recursive').recursive,
util = require('./util');
var config = util.whereTheMagicHappens(
global.process.mainModule
? path.dirname(global.process.mainModule.filename)
: process.cwd(),
process.env
).config;
function figs(bundle, b) {
var subset;
/**
* This is cheeky, but I'm attempting to detect if this was called by
* browserify.
*/
if (bundle === b && bundle instanceof Function && bundle.wrap instanceof Function) {
subset = config;
} else {
subset = bundle;
}
return util.browserify('/node_modules/figs/index.js', subset);
}
module.exports = merge(figs, config);