karolis-sh / electron-snowpack

Use Snowpack and esbuild for Electron app development
MIT License
50 stars 8 forks source link

feat: support passing electron arguments for dev command #47

Closed bgever closed 3 years ago

bgever commented 3 years ago

Adds support for the -- <args...> option on the dev command, and passes the remainder of the arguments (similar to npm start) to the underlying electron CLI executable.

This allows for passing arguments to the main.js in case the app supports processing CLI arguments.

The commander implementation automatically removes consumed arguments from the program.args array (like the --verbose in the previous example, and adds any "unconsumed" arguments after -- to the args property. The command name needs to be explicitly removed.

bgever commented 3 years ago

@karolis-sh Hope you find this feature useful. 😊 I'm using it locally to work with my app's CLI in dev mode.

karolis-sh commented 3 years ago

Thanks for the solid contribution! 👍

bgever commented 3 years ago

Thanks for accepting the PR and quick release. 🎉 And thanks for adding the example to the playground.