Skip to content

Commit d8ffe39

Browse files
committed
refactor: imports
1 parent 670966f commit d8ffe39

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/Server.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@ const fs = require('graceful-fs');
88
const ipaddr = require('ipaddr.js');
99
const internalIp = require('internal-ip');
1010
const killable = require('killable');
11-
const chokidar = require('chokidar');
1211
const express = require('express');
13-
const { createProxyMiddleware } = require('http-proxy-middleware');
14-
const historyApiFallback = require('connect-history-api-fallback');
1512
const compress = require('compression');
1613
const serveIndex = require('serve-index');
1714
const webpack = require('webpack');
@@ -246,6 +243,8 @@ class Server {
246243
// It is possible to use the `bypass` method without a `target`.
247244
// However, the proxy middleware has no use in this case, and will fail to instantiate.
248245
if (proxyConfig.target) {
246+
const { createProxyMiddleware } = require('http-proxy-middleware');
247+
249248
return createProxyMiddleware(context, proxyConfig);
250249
}
251250
};
@@ -319,6 +318,8 @@ class Server {
319318
}
320319

321320
setupHistoryApiFallbackFeature() {
321+
const historyApiFallback = require('connect-history-api-fallback');
322+
322323
const fallback =
323324
typeof this.options.historyApiFallback === 'object'
324325
? this.options.historyApiFallback
@@ -1050,6 +1051,8 @@ class Server {
10501051
interval,
10511052
};
10521053

1054+
const chokidar = require('chokidar');
1055+
10531056
const watcher = chokidar.watch(watchPath, finalWatchOptions);
10541057

10551058
// disabling refreshing on changing the content

0 commit comments

Comments
 (0)