You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
Reacted by Efriandika Pratama, Morgan O'Neal, Ivan Valentinov, Ritesh Kumar, Joe, Peter Malina, Savvas Nicholas and Ron Edgecomb II
@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?
Activity
TheLarkInn commentedon Aug 8, 2016
I think that's more than doable. @iamyojimbo would you like to submit a PR?
iamyojimbo commentedon Aug 8, 2016
@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.jsat the root, and literally any property you put in there would override whatever is in the defaults in CLI? So we would built thedefaultswebpack object, then pass it through something which blindly overrides with the custom config?Too simplistic? Are there any other considerations?
petomalina commentedon Aug 8, 2016
This could be a good inspiration. https://github.com/AngularClass/angular2-webpack-starter
Feels like these are important:
https://github.com/AngularClass/angular2-webpack-starter/blob/master/webpack.config.js
https://github.com/AngularClass/angular2-webpack-starter/tree/master/config
angular-automatic-lock-bot commentedon Sep 6, 2019
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.