Skip to content

Commit b7b5478

Browse files
authored
Don't require package.json to exist for crawlFrameworkPkgs (#16)
1 parent 277ce18 commit b7b5478

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

Diff for: src/index.js

+4-8
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,10 @@ export { isDepIncluded, isDepExcluded, isDepNoExternaled, isDepExternaled }
2323
export async function crawlFrameworkPkgs(options) {
2424
const pkgJsonPath = await findClosestPkgJsonPath(options.root)
2525
if (!pkgJsonPath) {
26-
// @ts-expect-error don't throw in deno as package.json is not required
27-
if (typeof Deno !== 'undefined') {
28-
return {
29-
optimizeDeps: { include: [], exclude: [] },
30-
ssr: { noExternal: [], external: [] }
31-
}
32-
} else {
33-
throw new Error(`Cannot find package.json from ${options.root}`)
26+
// don't throw as package.json is not required
27+
return {
28+
optimizeDeps: { include: [], exclude: [] },
29+
ssr: { noExternal: [], external: [] }
3430
}
3531
}
3632
const pkgJson = await readJson(pkgJsonPath).catch((e) => {

0 commit comments

Comments
 (0)