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

Passing command-line arguments to electron #3603

Open
RedX2501 opened this issue Apr 22, 2024 · 1 comment
Open

Passing command-line arguments to electron #3603

RedX2501 opened this issue Apr 22, 2024 · 1 comment
Labels

Comments

@RedX2501
Copy link

Summary

I'd like to pass some command-line arguments from intellij to may electron app.

For example if it was a simple electron app i'd run it with ./node_modules/.bin/electron main.js --arg1=value --arg2=value

But I simply add arguments to node or webpack directly I receive all kind of 'arguments not recognized` errors by webpack.

How do I do this with the boilerplate?

@xupea
Copy link
Contributor

xupea commented May 9, 2024

in root packge.json, you can do:

"start:main": "cross-env NODE_ENV=development electronmon -r ts-node/register/transpile-only . --arg1=value --arg2=value",

Then you can get args from main process

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants