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

Extending webpack config #1583

Closed
iamyojimbo opened this issue Aug 7, 2016 · 4 comments · Fixed by #1599
Closed

Extending webpack config #1583

iamyojimbo opened this issue Aug 7, 2016 · 4 comments · Fixed by #1599

Comments

@iamyojimbo
Copy link

OS?

OSX v 10.11.4

Versions

angular-cli: 1.0.0-beta.11-webpack
node: 6.2.2
os: darwin x64

Repro steps.

  • App created with CLI (webpack).
  • I am trying to use a package lokijs. I ran npm install --save lokijs.
  • In my code, I then do: var loki = require("lokijs");
  • I receive this error on ng build:
ERROR in ./~/fs/index.js
Module build failed: Error: ENOENT: no such file or directory, open '/Users/savvas/code/tlbiolabs/node_modules/fs/index.js'
    at Error (native)
 @ ./~/lokijs/src/lokijs.js 1141:16-29
 @ ./src/app/shared/services/data-sync/pouch-loki-sync.ts
 @ ./src/app/shared/services/data-sync/index.ts
 @ ./src/app/shared/services/data.service.ts
 @ ./src/main.ts
 @ multi main
  • This is a known issue with lokijs and webpack, reported here and even with another package, plugjs, here.
  • The solution is to add fs: 'empty' to webpack.config.js
  • I can't see any way to extend the internal config of the CLI. Is this possible?

The log given by the failure

(as above)

@TheLarkInn
Copy link
Member

I think that's more than doable. @iamyojimbo would you like to submit a PR?

@iamyojimbo
Copy link
Author

@TheLarkInn I would love to. Can you point me in the right direction on how to get this done technically as I'm only 4 days into angular-cli at the moment?

We would have a webpack.config.js at the root, and literally any property you put in there would override whatever is in the defaults in CLI? So we would built the defaults webpack object, then pass it through something which blindly overrides with the custom config?

Too simplistic? Are there any other considerations?

@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 6, 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 a pull request may close this issue.

4 participants