Skip to content

Commit

Permalink
fix(plugin-vite): return undefined avoid packagerConfig.ignore lo…
Browse files Browse the repository at this point in the history
…gic BUG
  • Loading branch information
caoxiemeihao committed Apr 30, 2024
1 parent 09b372d commit 7fc7a19
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/plugin/vite/src/VitePlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,18 @@ Your packaged app may be larger than expected if you dont ignore everything othe
// `file` always starts with `/`
// @see - https://github.com/electron/packager/blob/v18.1.3/src/copy-filter.ts#L89-L93

// Collect dependencies from package.json
// Collect dependencies from package.json by default
if (file.startsWith('/node_modules')) {
const [, , name] = file.split('/');
return flatDeps.some((dep) => dep.name === name);
const isProDep = flatDeps.some((dep) => dep.name === name);
if (isProDep) return false;
} else {
// Collect the files built by Vite
return !file.startsWith('/.vite');
}

// Collect the files built by Vite
return !file.startsWith('/.vite');
// TODO: return false behavior diff than reutrn undefined
return undefined as unknown as boolean;
};
return forgeConfig;
};
Expand Down

0 comments on commit 7fc7a19

Please sign in to comment.