Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

108
Vistas
Dynamic Import using async await inside domReady

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? I just follow the sample here: https://github.com/roots/sage/blob/main/resources/scripts/app.js

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);
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda