question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow override of webpackJsonp behavior

See original GitHub issue

Feature request: provide API to hook into webpackJsonp

What is the current behavior? When using code splitting, Webpack uses webpackJsonp function to load chunks asynchronously in a browser when a code path that requires that chunk is invoked. On the server Webpack does not do anything for loading async chunks because it doesn’t know what to do.

What is the expected behavior? Provide an API for overriding webpackJsonp behavior so users can hook into it and inject async chunks in HTML that server returns.

If this is a feature request, what is motivation or use case for changing the behavior? Making code splitting with async routes is very hard. Solutions like webpack-flush-chunks seems way too hacky for doing something simple like this.

Question: when targeting node does web pack do anything different for async chunks?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mohsen1commented, Mar 20, 2018
1reaction
sokracommented, Jul 14, 2017

when targeting node does web pack do anything different for async chunks?

yes, it uses require (target node) or fs + vm (target async-node) to load chunks.


You can override the __webpack_chunk_load__ function in a bundle to hook into the chunk loading behavior.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Webpack override behavior of require - Stack Overflow
Finally fixed by writing my own loader and setting the default property on the module exports explicitly.
Read more >
Output - webpack
System modules require that a global variable System is present in the browser when the webpack bundle is executed. Compiling to System.register format...
Read more >
Overview - Joe Sandbox
Sample URL: https://infogram.com/insurances-renewal-override-1h984wkj01vv4p3?live. Analysis system description: Windows 10 64 bit (version 1803) with Office ...
Read more >
mini-extract-plugin - npm
Exposes 18 hooks that enable you to: Override how the modules are parsed when passed to the loader; Override how the modules are...
Read more >
[RTFACT-21225] HTTP SSO working sporadically - Jira - JFrog
Access-Control-Allow-Headers: X-Requested-With, Content-Type, X-Codingpedia ... 1 X-Artifactory-User: MLXD X-Artifactory-Override-Base-Url: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found