Skip to content

Commit 4875fc3

Browse files
committed
perf(cmd-api-server): shrink API server bundle with type-only imports
Great explanation can be found here: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html Signed-off-by: Peter Somogyvari <[email protected]>
1 parent 240bb1a commit 4875fc3

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

packages/cactus-cmd-api-server/src/main/typescript/api-server.ts

+6-11
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
import path from "path";
2-
import { gte } from "semver";
3-
import { AddressInfo } from "net";
2+
import type { AddressInfo } from "net";
43
import tls from "tls";
54
import { Server, createServer } from "http";
6-
import { Server as SecureServer } from "https";
5+
import type { Server as SecureServer } from "https";
76
import { createServer as createSecureServer } from "https";
7+
import { gte } from "semver";
88
import npm from "npm";
99
import expressHttpProxy from "express-http-proxy";
10-
import express, {
11-
Express,
12-
Request,
13-
Response,
14-
RequestHandler,
15-
Application,
16-
} from "express";
10+
import type { Application, Request, Response, RequestHandler } from "express";
11+
import express from "express";
1712
import { OpenApiValidator } from "express-openapi-validator";
1813
import compression from "compression";
1914
import bodyParser from "body-parser";
@@ -377,7 +372,7 @@ export class ApiServer {
377372
},
378373
});
379374

380-
const app: Express = express();
375+
const app: Application = express();
381376
app.use("/api/v*", apiProxyMiddleware);
382377
app.use(compression());
383378
app.use(corsMiddleware);

0 commit comments

Comments
 (0)