Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

dynamic compilation - Compile Angular 4 AMD bundles in Angular 10 Dynamically

I’m working on an Angular application with a system of plugins that are each taken in as a AMD bundle and then compiled with compiler.compileModuleAsync. This worked in Angular 9, but in Angular 10, we are hitting a problem. All of the plugins (mostly built in Angular 6 or less) throw a ?mod not found error on loading.

Specifically, I am loading a plugin build in Angular 4 that was converted to an AMD bundle. The error gets thrown when a module import is compiled. It says "SUB_MODULE does not have '?mod' property."

I’ve tried to dynamically run ?compileNgModule and ?compileNgModuleDefs but nothing seems to get the plugin to load. We would like to maintain backwards compatability, if at all possible. If anyone can point me in the right direction, that would be great! Thanks so much in advance!

question from:https://stackoverflow.com/questions/65888877/compile-angular-4-amd-bundles-in-angular-10-dynamically

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...