Merge pull request #547 from silentrald/fix/issue-546

[bugfix] exclude regedit-rs on externals when webpack bundles it in linux
This commit is contained in:
MathieuG-P
2024-08-04 11:19:34 +02:00
committed by GitHub
+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",