[bugfix] exclude regedit-rs on externals when webpack bundles it in linux

This commit is contained in:
silentrald
2024-08-03 12:00:03 +08:00
parent eb30400b7c
commit b2a57ea307
+13 -1
View File
@@ -6,8 +6,20 @@ import webpack from "webpack";
import webpackPaths from "./webpack.paths";
import { dependencies as externals } from "../../release/app/package.json";
function createExternals(): string[] {
const webpackExternals: string[] = [...Object.keys(externals || {})];
const excludedExternals: string[] = [];
if (process.platform === "linux") {
// Linux only uses regedit-rs types
excludedExternals.push("regedit-rs");
}
return webpackExternals.filter(external => !excludedExternals.includes(external));
}
const configuration: webpack.Configuration = {
externals: [...Object.keys(externals || {})],
externals: createExternals(),
stats: "errors-only",