I have a Typescript class where I am attempting to perform a synchronous import, however, the import is being executed asynchronously. My code snippet looks like this:
--------------100 lines of code--------------------
import('../../../x/y/z').then((x) => {
alert('Component')
});
--------------100 lines of code----------------------
Unfortunately, using this approach, the alert message is only displayed at the end after all 200 lines are executed asynchronously due to the Promise being used internally. Is there a way to ensure that it executes in a serial order while keeping the imports dynamic?
Thank you.