Skip to content

Using --target node and --target electron #4

@nyxynyx

Description

@nyxynyx

Hello there, your boilerplate is working great until I encountered the errors fs.existsSync is not a function and Cannot statically evaluate fs argument after trying to use another npm package. While trying to troubleshoot it, I tried to specify the Parcel targets node and electron by changing the line in package.json from

"react-start": "parcel -p 3000 index.html --out-dir build",

to

"react-start": "parcel -p 3000 index.html --out-dir build --target node",

and

"react-start": "parcel -p 3000 index.html --out-dir build --target electron",

However, running yarn start no longer launch the Electron app and no server is listening to http://localhost:3000.

What is the correct way to set the targets to node and electron?

Thank you very much!


GitHub Repo to reproduce problem:
https://github.com/nyxynyx/electron-react-parcel-boilerplate-problem

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions