Aot and minimization in Angular 4 with external modules

I am using the Angular CLI to create an Angular 4 application. Before deploying to prod, I would like to do aot and minification. So I ran the following command

ng build --environment=prod --prod --base-href /myapp/

It gives me an error below

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

A Datepicker module that complains about it with an external module ( https://www.npmjs.com/package/angular-io-datepicker ).

Can anyone suggest what might be wrong and how can I solve it?

+4
source share
2 answers

@ angular/cli

, npm

npm enhance-resolve@3.3.0

+1

Source: https://habr.com/ru/post/1682596/


All Articles