Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/electron-webpack/src/dev/dev-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,13 @@ class DevRunner {
logError("Main", error)
})

const electronWebpackConfig = await getElectronWebpackConfiguration({
projectDir,
packageMetadata: getPackageMetadata(projectDir),
})
const electronArgs = process.env.ELECTRON_ARGS
const args = electronArgs != null && electronArgs.length > 0 ? JSON.parse(electronArgs) : [`--inspect=${await getFreePort("127.0.0.1", 5858)}`]
args.push(path.join(projectDir, "dist/main/main.js"))
args.push(path.join(electronWebpackConfig.commonDistDirectory!!, "main/main.js"))
// Pass remaining arguments to the application. Remove 3 instead of 2, to remove the `dev` argument as well.
args.push(...process.argv.slice(3))
// we should start only when both start and main are started
Expand Down