1 | ;
|
2 |
|
3 | /**
|
4 | * Lazily-required module dependencies (makes the application
|
5 | * faster)
|
6 | */
|
7 |
|
8 | var utils = require('lazy-cache')(require);
|
9 |
|
10 | /**
|
11 | * Temporarily re-assign `require` to trick browserify and
|
12 | * webpack into recognizing lazy dependencies.
|
13 | *
|
14 | * This tiny bit of ugliness has the huge dual advantage of
|
15 | * only loading modules that are actually called at some
|
16 | * point in the lifecycle of the application, whilst also
|
17 | * allowing browserify and webpack to find modules that
|
18 | * are depended on but never actually called.
|
19 | */
|
20 |
|
21 | var fn = require;
|
22 | require = utils;
|
23 |
|
24 | /**
|
25 | * Lazily required module dependencies
|
26 | */
|
27 |
|
28 | require('async');
|
29 | require('get-pkg', 'pkg');
|
30 |
|
31 | /**
|
32 | * Restore `require`
|
33 | */
|
34 |
|
35 | require = fn;
|
36 |
|
37 | /**
|
38 | * Expose `utils` modules
|
39 | */
|
40 |
|
41 | module.exports = utils;
|