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

Find a way to make universal "npm run dev" #314

Open
mkoskim opened this issue Dec 18, 2024 · 2 comments
Open

Find a way to make universal "npm run dev" #314

mkoskim opened this issue Dec 18, 2024 · 2 comments

Comments

@mkoskim
Copy link
Owner

mkoskim commented Dec 18, 2024

Windows machines generally do not have Bash shell, so the script in "npm run dev" target does not work. There may be existing solutions for this, so I should go looking for those. At the mean time, README gives instructions how to run commands separately.

@ZacharyHandel
Copy link
Contributor

I think it would benefit Windows developers with a guide on how to set up ElectronJS debugging in VS Code. Here is what I have discovered:

  1. Include this launch.json file in your development environement as mawejs/.vscode/launch.json:
{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "Electron: Main",
            "runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron",
            "runtimeArgs": [
                "--remote-debugging-port=9223",
                "."
            ],
            "windows": {
                "runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron.cmd"
            }
        },
        {
            "name": "Electron: Renderer",
            "type": "chrome",
            "request": "attach",
            "port": 9223,
            "webRoot": "${workspaceFolder}",
            "timeout": 30000
        }
    ],
    "compounds": [
        {
            "name": "Electron: All",
            "configurations": [
                "Electron: Main",
                "Electron: Renderer"
            ]
        }
    ]
}
  1. in a terminal, run npm run dev:react
  2. Go to the "Run and Debug" tab on the left of VS code.
  3. At the top of the "Run and Debug" tab, run Electron:Main.
  4. After that is up and running, run Electron:Renderer (The renderer is dependent on the Electron:Main to be running due to the nature of ElectronJS being a two process framework.
  5. Debug away!

This would need to be tested for MAC and Linux developers. Thoughts? This is how I am debuggin while developing.

@mkoskim
Copy link
Owner Author

mkoskim commented Dec 19, 2024

We could make this as a new issue. E.g. VS debug support. You could basically put your settings coming as PR, I could check how it works on Linux.

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

No branches or pull requests

2 participants