Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not use import2() more for webpack build. #57

Merged
merged 1 commit into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"email": "[email protected]",
"url": "https://github.com/samchon"
},
"version": "0.8.8",
"version": "0.8.9",
"main": "index.js",
"typings": "index.d.ts",
"scripts": {
Expand All @@ -26,7 +26,6 @@
"test:node": "node dist/test/node"
},
"dependencies": {
"import2": "^1.0.0",
"serialize-error": "^4.1.0",
"tstl": "^2.5.13",
"uuid": "^9.0.0",
Expand Down
15 changes: 7 additions & 8 deletions src/utils/internal/NodeModule.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import include from "import2";
import type * as __cp from "child_process";
import type * as __fs from "fs";
import type * as __http from "http";
Expand All @@ -11,24 +10,24 @@ import { Singleton } from "tstl/thread/Singleton";

export namespace NodeModule {
export const cp: Singleton<Promise<typeof __cp>> = new Singleton(() =>
include("child_process"),
import("child_process"),
);
export const fs: Singleton<Promise<typeof __fs>> = new Singleton(() =>
include("fs"),
import("fs"),
);
export const http: Singleton<Promise<typeof __http>> = new Singleton(() =>
include("http"),
import("http"),
);
export const https: Singleton<Promise<typeof __https>> = new Singleton(() =>
include("https"),
import("https"),
);
export const os: Singleton<Promise<typeof __os>> = new Singleton(() =>
include("os"),
import("os"),
);
export const thread: Singleton<Promise<typeof __thread>> = new Singleton(
() => include("worker_threads"),
() => import("worker_threads"),
);
export const ws: Singleton<Promise<typeof __ws>> = new Singleton(() =>
include("ws"),
import("ws"),
);
}