Skip to content

Commit

Permalink
feat: Support Yarn PnP
Browse files Browse the repository at this point in the history
  • Loading branch information
jclab-joseph committed Apr 7, 2023
1 parent 5b40a8d commit fc38e7f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/api/core/src/api/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ export default async ({
} as NodeJS.ProcessEnv,
};

delete spawnOpts.env.NODE_OPTIONS;

if (runAsNode) {
spawnOpts.env.ELECTRON_RUN_AS_NODE = 'true';
} else {
Expand Down
7 changes: 7 additions & 0 deletions packages/utils/core-utils/src/electron-version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ function getElectronModuleName(packageJSON: PackageJSONWithDeps): string {
async function getElectronPackageJSONPath(dir: string, packageName: string): Promise<string | undefined> {
const nodeModulesPath = await determineNodeModulesPath(dir, packageName);
if (!nodeModulesPath) {
try {
// Yarn PnP
// eslint-disable-next-line node/no-missing-require
return require.resolve('electron/package.json');
} catch (e) {
// Ignore
}
throw new PackageNotFoundError(packageName, dir);
}

Expand Down

0 comments on commit fc38e7f

Please sign in to comment.