FrontendDeveloper.in

JavaScript question detail

What are dynamic imports

The dynamic imports using import() function syntax allows us to load modules on demand by using promises or the async/await syntax. Currently this feature is in stage4 proposal. The main advantage of dynamic imports is reduction of our bundle's sizes, the size/payload response of our requests and overall improvements in the user experience. The syntax of dynamic imports would be as below,

import("./Module").then((Module) => Module.method());
Back to all JavaScript questions
Get LinkedIn Premium at Rs 399