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

add webpack target configuration via angular-cli.json #3346

Closed
wants to merge 4 commits into from

Conversation

vilarone
Copy link

@vilarone vilarone commented Dec 1, 2016

Add webpack target config into angular-cli.json

Causes:
When I import electron import { ipcRenderer } from 'electron'; and run with electron ng build complete correctly but in electron renderer cause Uncaught TypeError: fs.readFileSync is not a function

Solution:
Add the webpack target configuration to electron-renderer to compile for electron renderer process
See webpack configuration target for more compile methods
Can usage the other target configuration and predefined the default when undefined in angular-cli.json

Example:

    {
      "root": "src",
      "outDir": "dist",
      "assets": [
        "assets",
        "favicon.ico"
      ],
      "index": "index.html",
      "main": "main.ts",
      "test": "test.ts",
      "tsconfig": "tsconfig.json",
      "prefix": "app",
      "mobile": false,
      "styles": [
        "styles.css"
      ],
      "scripts": [],
      "environments": {
        "source": "environments/environment.ts",
        "dev": "environments/environment.ts",
        "prod": "environments/environment.prod.ts"
      },
      "target": "electron-renderer" <---- new property. ["web","webworker","node","async-node","node-webkit","electron","electron-renderer"]
    }```

@clydin
Copy link
Member

clydin commented Dec 2, 2016

This would probably be better served as a new CLI app "type" with custom blueprints, etc.
Although that would be a post-1.0 feature due to the need for the add-on system.

@friksa
Copy link

friksa commented Dec 18, 2016

+1 for electron support

btw, angular-cli rocks!!

@filipesilva
Copy link
Contributor

Closing for the same reason as #4227 (comment).

Not to say we won't add it in the future, but it's just not something we're looking at for now.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants