Skip to content

Commit 7ebaa8a

Browse files
author
Guillaume Chau
committed
fix: remove read-pkg
1 parent 4f910b1 commit 7ebaa8a

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

packages/@vue/cli-ui/apollo-server/connectors/folders.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ const path = require('path')
22
const fs = require('fs-extra')
33
const LRU = require('lru-cache')
44
const winattr = require('@akryum/winattr')
5-
const readPkg = require('read-pkg')
65

76
const hiddenPrefix = '.'
87
const isPlatformWindows = process.platform.indexOf('win') === 0
@@ -101,8 +100,9 @@ function readPackage (file, context, force = false) {
101100
return cachedValue
102101
}
103102
}
104-
if (fs.existsSync(path.join(file, 'package.json'))) {
105-
const pkg = readPkg.sync({ cwd: file })
103+
const pkgFile = path.join(file, 'package.json')
104+
if (fs.existsSync(pkgFile)) {
105+
const pkg = fs.readJsonSync(pkgFile)
106106
pkgCache.set(file, pkg)
107107
return pkg
108108
}

packages/@vue/cli-ui/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
"node-notifier": "^5.2.1",
5050
"parse-git-config": "^2.0.2",
5151
"portfinder": "^1.0.13",
52-
"read-pkg": "^4.0.1",
5352
"semver": "^5.5.0",
5453
"shortid": "^2.2.11",
5554
"terminate": "^2.1.0",

0 commit comments

Comments
 (0)