Skip to content

Can't deploy Electron app with angular app #313

@S-Mitterlehner

Description

@S-Mitterlehner

I have an existing nx workspace with an angular app inside.
Now I added an electron app via nx generate app and attached the angular project to it.

When I start the app with the command start.electron.sample-windows it works perfectly fine.

Now I want to build and deploy the electron-app but I'm running to an issue. Whenever I run the command build.electron.sample-windows.windows I get the error that the system can't find the path dist/apps/electron-sample-windows.
What is actually true, because during the process it just builds the angular app.

When I look into the angular.json file I see that the project electron-sample-windows points to the path of my angular app.

Is there an issue while generating the elecrton app?

here are the depending scripts from the package.json:

"scripts": {
    "ng": "nx",
    "postinstall": "node ./decorate-angular-cli.js && ngcc --properties es2020 browser module main && electron-rebuild install-app-deps && electron-rebuild install-app-deps",
    "start": "nx serve",
    "build": "nx build",
    "test": "nx test",
    "build.electron.sample-windows": "npm run prepare.electron.sample-windows && ng build --project=electron-sample-windows --prod --base-href ./",
    "build.electron.sample-windows.local": "npm run build.electron.sample-windows && electron dist/apps/electron-sample-windows",
    "build.electron.sample-windows.linux": "npm run build.electron.sample-windows && cd dist/apps/electron-sample-windows && npx electron-builder build --linux",
    "build.electron.sample-windows.windows": "npm run build.electron.sample-windows && cd dist/apps/electron-sample-windows && npx electron-builder build --windows",
    "build.electron.sample-windows.mac": "npm run build.electron.sample-windows && cd dist/apps/electron-sample-windows && npx electron-builder build --mac",
    "prepare.electron.sample-windows": "tsc -p apps/electron-sample-windows/tsconfig.json",
    "serve.electron.sample-windows.target": "nx serve electron-sample-windows",
    "serve.electron.sample-windows": "wait-on http-get://localhost:4200/ && electron apps/electron-sample-windows/src --serve",
    "start.electron.sample-windows": "npm run prepare.electron.sample-windows && npm-run-all -p serve.electron.sample-windows.target serve.electron.sample-windows"
  },

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions