I'm coding an online game that loads levels dynamically with the following line:
import('/path/level.js')
.catch((error) => { reject(error); })
.then((data) => {
// Display the new level
// ...
}
This is a single page application, and the levels are loaded dynamically. The levels are heavy Webpack bundles. I would like to display a progress bar during the import.
Is there a way to get the status of the import ? Like a percentage or a number of bytes loaded?