Skip to content

Extending webpack config #1583

@iamyojimbo

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)

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