lmeijdam / angular-umd-dynamic-example

Angular UMD example of loading new modules dynamically
174 stars 57 forks source link

it can't run in production mode. #8

Closed jol5 closed 5 years ago

jol5 commented 5 years ago

image I haven't made any changes. just running in ng serve --prod .

LeoLetourneur commented 5 years ago

Can you try

ng serve --prod --optimization=false

With ng build --prod, I had to use --build-optimizer=false

Optimization breaks a link somewhere...

jol5 commented 5 years ago

thanks!!! this.compiler.compileModuleAndAllComponentsAsync( >>>this code will load all component of my dependence over the --prod 。so, it will be slow at first time . image

lmeijdam commented 5 years ago

you did solve it by not changing any code or? original code; return this.compiler.compileModuleAndAllComponentsAsync(module[${moduleInfo.moduleName}]).then(compiled => {

jol5 commented 5 years ago

you did solve it by not changing any code or? original code; return this.compiler.compileModuleAndAllComponentsAsync(module[${moduleInfo.moduleName}]).then(compiled => {

yes!

lmeijdam commented 5 years ago

any chance of sharing what you changed? ;)

jol5 commented 5 years ago

any chance of sharing what you changed? ;) nothing change;

lmeijdam commented 5 years ago

Okay I will close this issue! 👍