Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explain what is output.chunkLoadingGlobal #6336

Open
1 task done
yvele opened this issue Aug 16, 2022 · 2 comments
Open
1 task done

Explain what is output.chunkLoadingGlobal #6336

yvele opened this issue Aug 16, 2022 · 2 comments

Comments

@yvele
Copy link

yvele commented Aug 16, 2022

Feature to document

output.chunkLoadingGlobal

Author(s)

Additional information

Previously on Webpack 4 we had a decently documented output.jsonpFunction output configuration option.

Looks like peoples says that Webpack 4 output.jsonpFunction is now Webpack 5 output.chunkLoadingGlobal:

But the documentation in Webpack 5 is pretty poor:

I don't understand the difference between jsonpFunction and chunkLoadingGlobal.
Could you explain in the documentation that exactly is chunkLoadingGlobal and most importantly: What problem does is solves? 🤔

For example I have an erratic TypeError: webpack_modules[moduleId] is not a function and I'm not sure if chunkLoadingGlobal may solve the problem 🤔

Should we systematically define a specific chunkLoadingGlobal when we run multiple Webpack instances on the same page? Why?

Is this 2017 article still https://medium.com/@cliffers/how-to-run-multiple-webpack-instances-on-the-same-page-and-avoid-any-conflicts-4e2fe0f016d1 still relevant?

  • I am willing to work on this issue and submit a pull request.
@yvele
Copy link
Author

yvele commented Aug 16, 2022

Hum I see... it's also about output.uniqueName

@ReinisV
Copy link

ReinisV commented Apr 20, 2023

Also an interesting thing I'd like to see explained in the docs is how does this field affect webpack configs with multiple entrypoints.

i.e. if I set chunkLoadingGlobal to myCustomGlobalName and then have two different entry points declared, wont both of those entry points use myCustomGlobalName?

and then if both of those entry points are loaded on the same page (but separately), won't they overwrite each others myCustomGlobalName objects?

how do you work around that? is there a way to set unique chunkLoadingGlobal on a per entrypoint basis?

edit:
also asked here: #3940 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants