Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function withExpoWebpack(
config: AnyConfiguration,
options: { projectRoot?: string; skipEntry?: boolean } = {}
) {
// Support React Native aliases
// @ts-ignore: webpack version mismatch
config = withAlias(config);
const projectRoot = options.projectRoot || process.cwd();
const env: any = {
platform: 'electron',
projectRoot,
mode: config.mode === 'production' ? config.mode : 'development',
locations: getPaths(projectRoot),
};
if (!config.plugins) config.plugins = [];
if (!config.resolve) config.resolve = {};
env.config = getConfig(env);
const [plugin] = getPluginsByName(config, 'HtmlWebpackPlugin');
if (plugin) {