Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (env == null) {
env = {}
}
const projectDir = (env.configuration || {}).projectDir || process.cwd()
const packageMetadata = getPackageMetadata(projectDir)
const electronWebpackConfig = await getElectronWebpackConfiguration({
packageMetadata,
projectDir,
})
if (env.configuration != null) {
deepAssign(electronWebpackConfig, env.configuration)
}
await validateConfig(electronWebpackConfig, schemeDataPromise, message => {
return `${message}
How to fix:
1. Open https://webpack.electron.build/configuration
2. Search the option name on the page.
* Not found? The option was deprecated or not exists (check spelling).
* Found? Check that the option in the appropriate place. e.g. "sourceDirectory" only in the "main" or "renderer", not in the root.
`
})
return new WebpackConfigurator(type, env, electronWebpackConfig, await packageMetadata.value)
}