From 0ffb8068f86d6a1a81fc6b6b147b83248c8cad2a Mon Sep 17 00:00:00 2001 From: Jeongho Nam Date: Tue, 21 Nov 2023 14:37:54 +0900 Subject: [PATCH] Do not use `import2()` more for webpack build. When building webpack of node application without node_modules, `import2()` statements be a great obstable for that. Therefore, stopped using it for such special bundling. --- package.json | 3 +-- src/utils/internal/NodeModule.ts | 15 +++++++-------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 96bdce0..fa9c2fc 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "email": "samchon.github@gmail.com", "url": "https://github.com/samchon" }, - "version": "0.8.8", + "version": "0.8.9", "main": "index.js", "typings": "index.d.ts", "scripts": { @@ -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", diff --git a/src/utils/internal/NodeModule.ts b/src/utils/internal/NodeModule.ts index 95bb36d..03c0f4f 100644 --- a/src/utils/internal/NodeModule.ts +++ b/src/utils/internal/NodeModule.ts @@ -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"; @@ -11,24 +10,24 @@ import { Singleton } from "tstl/thread/Singleton"; export namespace NodeModule { export const cp: Singleton> = new Singleton(() => - include("child_process"), + import("child_process"), ); export const fs: Singleton> = new Singleton(() => - include("fs"), + import("fs"), ); export const http: Singleton> = new Singleton(() => - include("http"), + import("http"), ); export const https: Singleton> = new Singleton(() => - include("https"), + import("https"), ); export const os: Singleton> = new Singleton(() => - include("os"), + import("os"), ); export const thread: Singleton> = new Singleton( - () => include("worker_threads"), + () => import("worker_threads"), ); export const ws: Singleton> = new Singleton(() => - include("ws"), + import("ws"), ); }