Skip to content

Commit d722a35

Browse files
committed
fix: lazy-load fs-extra and semver
1 parent 1ca7344 commit d722a35

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@
4141
"includeNodeModules": {
4242
"atom": false,
4343
"electron": false,
44-
"atom-languageclient": false,
45-
"fs-extra": false
44+
"atom-languageclient": false
4645
},
4746
"isLibrary": true
4847
}

src/installation.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { copy, pathExists } from "fs-extra"
1+
import { pathExists } from "fs-extra"
22
import { join, dirname } from "path"
3-
import semverCompare from "semver/functions/compare"
43

54
import { execFile as execFileRaw } from "child_process"
65
import { promisify } from "util"
@@ -43,6 +42,7 @@ async function getServeDVersion(file: string) {
4342

4443
/** Check if the given serve-d is up to date against the target version */
4544
export async function isServeDUpToDate(givenFile: string, targetFile: string) {
45+
const semverCompare = (await import("semver/functions/compare")).default
4646
const [givenVersion, targetVersion] = await Promise.all([getServeDVersion(givenFile), getServeDVersion(targetFile)])
4747
if (
4848
typeof givenVersion === "string" &&
@@ -58,6 +58,7 @@ export async function isServeDUpToDate(givenFile: string, targetFile: string) {
5858
}
5959

6060
async function copyServeD(bundledServerFolder: string, codeDBinFolder: string) {
61+
const { copy } = await import("fs-extra")
6162
atom.notifications.addInfo("Installing D servers...")
6263
// copy the whole served folder
6364
await copy(bundledServerFolder, codeDBinFolder, { overwrite: true })

0 commit comments

Comments
 (0)