Skip to content

Commit

Permalink
fix missing package resolving during dev
Browse files Browse the repository at this point in the history
  • Loading branch information
FredKSchott committed May 27, 2020
1 parent da16fd0 commit 5a50d3f
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/commands/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import {
ImportMap,
isYarn,
openInBrowser,
resolveDependencyManifest,
} from '../util';
import {
FileBuilder,
Expand Down Expand Up @@ -223,13 +224,8 @@ export async function command(commandOptions: CommandOptions) {
if (missingPackageName.startsWith('@')) {
missingPackageName += '/' + deepPackagePathParts.shift();
}
let doesPackageExist = false;
try {
require.resolve(missingPackageName, {paths: [cwd]});
doesPackageExist = true;
} catch (err) {
// that's okay, it just doesn't exist
}
const [depManifestLoc] = resolveDependencyManifest(missingPackageName, cwd);
const doesPackageExist = !!depManifestLoc;
if (doesPackageExist && !currentlyRunningCommand) {
isLiveReloadPaused = true;
messageBus.emit('INSTALLING');
Expand Down

0 comments on commit 5a50d3f

Please sign in to comment.