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

angular-cli support #50

Closed
DrewHoo opened this issue Jun 12, 2019 · 3 comments
Closed

angular-cli support #50

DrewHoo opened this issue Jun 12, 2019 · 3 comments
Labels
🙋 no/question This does not need any changes

Comments

@DrewHoo
Copy link

DrewHoo commented Jun 12, 2019

Subject of the issue

Because Unified requires node globals & libraries, it cannot be used in Angular applications that use angular-cli >= 6.0.0

See this comment from angular-cli:
angular/angular-cli#9827 (comment)

Your environment

angular-cli >= 6.0

Expected behaviour

I can use unified in my app and ng serve does not fail

Actual behaviour

ng serve fails with

ERROR in ./node_modules/replace-ext/index.js
Module not found: Error: Can’t resolve ‘path’ in ‘/my-project/node_modules/replace-ext’
@ChristianMurphy
Copy link
Member

@DrewHoo could you setup a CodeSandbox with an example of the issue?
Using the defaults on CodeSandbox + Angular CLI, I'm not seeing an issue.
https://codesandbox.io/s/angular-unified-ewo6q

@ChristianMurphy
Copy link
Member

ChristianMurphy commented Jun 12, 2019

Unified requires node globals & libraries, it cannot be used in Angular applications that use angular-cli >= 6.0.0

Angular CLI can be fixed to work with node modules, by patching the webpack config to polyfill node packages.
See https://github.com/meltedspark/angular-builders/tree/master/packages/custom-webpack

@ChristianMurphy ChristianMurphy added the 🙋 no/question This does not need any changes label Jun 12, 2019
@DrewHoo
Copy link
Author

DrewHoo commented Jun 12, 2019

@ChristianMurphy I wouldn't expect that sandbox to produce the issue since it's using "@angular/cli": "1.6.6" I fooled around with the sandbox example for a minute but could not get it to reserve with an updated version of angular/cli. If I have time to come back to this I'll produce a sandbox with the issue.

That's a good lead on a workaround. I spent a few minutes trying to get the custom webpack fix to work, and it introduces a host of new problems (not surprising given that it is doing something that angular-cli explicitly does not want to do).

@wooorm wooorm changed the title Unified incompatible with angular-cli >= 6.0.0 angular-cli support Aug 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙋 no/question This does not need any changes
Development

No branches or pull requests

2 participants