I want to include google closure library into my angular 6 application. I have applied
npm install google-closure-compiler and npm install google-closure-library.
The app can be compiled and running. However, when I trying to run the tests I wrote with ng test, it has error messages:
ERROR in ./node_modules/google-closure-library/closure/goog/boostrap/nodejs.js
Module not found: Error: Can't resolve 'fs' in './node_modules/google-closure-library/closure/goog/bootstrap'
ERROR in ./node_modules/google-closure-library/closure/goog/promise/testsuiteadapter.js
Module not found: Error: Can't resolve 'promises_aplus_tests' in './node_modules/google-closure-library/closure/goog/promise/testsuiteadapter.js'
I use the angular official demo example and I just added the test and installed these two libraries. My guesses are I need to configure karma.conf.js, but I don't know how to do that, does anyone know how to solve this?
Try adding this to your webpack config
You can also see how its implemented with this
https://github.com/angular/closure-demo