Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (entries.renderer.length > 2) {
throw new Error(
`electron-adapter app entry hack doesn't work with this version of electron-webpack. The expected entry length should be 2, instead got: [${entries.renderer.join(
', '
)}]`
);
} else {
console.log(` Using custom entry point > ${expoEntryPointPath}`);
}
}
return entries;
};
}
const babelConfig = createBabelLoaderFromEnvironment(env);
// Modify externals https://github.com/electron-userland/electron-webpack/issues/81
const includeFunc = babelConfig.include as (path: string) => boolean;
if (config.externals) {
config.externals = (config.externals as any)
.map((external: any) => {
if (typeof external !== 'function') {
const relPath = path.join('node_modules', external);
if (!includeFunc(relPath)) return external;
return null;
}
return (ctx: any, req: any, cb: any) => {
const relPath = path.join('node_modules', req);
return includeFunc(relPath) ? cb() : external(ctx, req, cb);
};
})