Skip to content

Commit

Permalink
fix: only install modules once across all files
Browse files Browse the repository at this point in the history
  • Loading branch information
erickzhao committed Dec 4, 2020
1 parent 7ebbeac commit 57aa3d1
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/renderer/npm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ export async function getIsPackageManagerInstalled(

/**
* Finds npm modules in editor values, returning an array of modules.
*
* @param {EditorValues} values
* @returns {Array<string>}
*/
export function findModulesInEditors(values: EditorValues) {
const files = [values.main, values.renderer, values.preload];
Expand All @@ -85,7 +82,7 @@ export function findModulesInEditors(values: EditorValues) {

console.log('Modules Found:', modules);

return modules;
return Array.from(new Set(modules));
}

/**
Expand Down

0 comments on commit 57aa3d1

Please sign in to comment.