Skip to content

Commit f1124ef

Browse files
committed
Make requires lazy because npm2 is terrible
1 parent 61504e5 commit f1124ef

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
'use strict';
22

3-
const FastBoot = require('fastboot');
4-
const chalk = require('chalk');
53

64
function fastbootExpressMiddleware(distPath, options) {
5+
const FastBoot = require('fastboot');
6+
77
let opts = options;
88

99
if (arguments.length === 1) {
@@ -66,7 +66,10 @@ function fastbootExpressMiddleware(distPath, options) {
6666
};
6767
}
6868

69+
let chalk;
70+
6971
function _log(statusCode, message, startTime) {
72+
chalk = chalk || require('chalk');
7073
let color = statusCode === 200 ? 'green' : 'red';
7174
let now = new Date();
7275

0 commit comments

Comments
 (0)