I am using Angular CLI to build an Angular 4 app. Before deployment to prod, I would like to do aot and minification. So I executed the following command
ng build --environment=prod --prod --base-href /myapp/
This gives me the below error
ERROR in Error encountered resolving symbol values statically. Calling function 'ControlValueAccessorProviderFactory', function calls are not supported. Consi
der replacing the function or lambda with a reference to an exported function, resolving symbol DatePicker in D:/myapp/node_modules/angular-i
o-datepicker/src/datepicker/datePicker.d.ts, resolving symbol DatePicker in D:/myapp/node_modules/angular-io-datepicker/src/datepicker/datePi
cker.d.ts
ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in 'D:\myapp\src'
@ ./src/main.ts 4:0-74
@ multi ./src/main.ts
Datepicker module that it is complaining about it an external module (https://www.npmjs.com/package/angular-io-datepicker).
Can someone please suggest what could potentially be wrong and how could I resolve it?