Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use commonDistDirectory for main.js in dev mode #399

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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