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

145
Vistas
How does Webpack 4 allow chunks to load asynchronously?

According to this logbook entry, each javascript chunk pushes the arguments into webpackjsonp, an array, which is then processed by 'runtime'. If the chunk containing runtime runs before the other chunks have yet to push into the array, won't it be unable to process the chunks?

Additional info:
I have a website built with Angular, using the Angular build feature. Angular uses Webpack to bundle up all the javascript and the result is that the website only has four pairs of scripts (aside from the Cloudflare ones). Each of the scripts are inserted at the bottom of the website in the form <script src="scriptname.js" type="module"> These are two versions of main.js, polyfills.js, vendor.js and runtime.js, the same ones noted in this question (except I have two of each due to the differential loading stated in the answer).

For the scripts in ES2018, all of them are in the form (window.webpackJsonp = window.webpackJsonp || []).push([...]), except runtime.js, which is a IIFE. I presume that since runtime.js is an IIFE its the one in charge of processing the scripts (and indeed, its the only one that explicitly iterates over webpackjsonp. However, I don't really understand what's stopping runtime from running before the chunks are pushed into webpackjsonp. (In addition, when checking the request call stack, main.js is at the bottom, seemingly calling runtime.js, which then starts the other calls. I don't understand how this works either).

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