Skip to content

Extending webpack config #1583

Closed
Closed

Description

@iamyojimbo

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)

Activity

  1. TheLarkInn commented on Aug 8, 2016

    @TheLarkInn
    Member

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

  2. iamyojimbo commented on Aug 8, 2016

    @iamyojimbo
    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?

  3. angular-automatic-lock-bot commented on Sep 6, 2019

    @angular-automatic-lock-bot

    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.

  4. locked and limited conversation to collaborators on Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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