Webpack provides several methods for asynchronously loading modules ( require([], resolve) , import('...') , require.ensure ). Using these functions, webpack automatically breaks the resulting package into pieces containing the necessary modules.
And the question arises: how can I connect when webpack tries to download another package of packages and displays some loading animation (for example, nprogress.start() ) and then hides this animation ( nprogress.done() ) when loading a piece?
I tried to find the webpack hooks, but all I could find was related to the compilation phase and not to the runtime (like this )
source share