Hello guys,
I’m really sorry for this question. I’m not so familiar with async await but I’m still learning how to use it properly. I just want to ask if this is the correct way to add dynamic import inside domready? Or do I need to place it outside const main?
import { domReady } from '@roots/sage/client';
const main = async (err) => {
if (err) {
// handle hmr errors
console.error(err);
}
(async() => {
const conditionalScript = await import('./home.js');
conditionalScript.test();
})();
// $win.on('resize', function () {
// });
};
domReady(main);
import.meta.webpackHot?.accept(main);