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

feat: add stats option to webpack plugin #778

Closed
wants to merge 2 commits into from

Conversation

depoulo
Copy link
Contributor

@depoulo depoulo commented May 26, 2021

Summary

Fix #770 as per my suggestion.

Test plan

  1. Use plugin as before. Output should be identical.
  2. Use plugin while passing custom stats options. The generated stats JSON file matches those options.

@tomkelsey
Copy link
Contributor

Hey,

I've read the related conversation to this PR and saw (#770 (comment)) you say perhaps this was overkill and that #779 would suffice.

Personally, I re-use the assets json file for a few other bits and bobs and so the most recent update to loadable-components broke my setup. I've had to patch the code to add in an extra stats option (namely entrypoints) so this PR - allowing people to customise the stats options - would still be valuable for my use case 👍

@depoulo depoulo marked this pull request as ready for review May 26, 2021 17:03
@depoulo
Copy link
Contributor Author

depoulo commented May 26, 2021

Good point. While we're waiting for a maintainer's opinion on this, feel free to use

"@loadable/webpack-plugin": "depoulo/loadable-components#@loadable/webpack-plugin/stats-opts-770/5.16.0",

in your package.json in the meantime (still better than patching the code).

@theKashey
Copy link
Collaborator

Actually I always thought about splitting plugin into two parts - Webpack and stats.

you should not use plugin output for anything except loadable itself, please try to learn from this incident...
But nothing is stopping loadable to derive stats it needs from “your stats”

that automatically “grants” you ability to use any plugin you want and decouples loadable server from Webpack integration.

assisrafael added a commit to assisrafael/react-app-boilerplate that referenced this pull request Jul 14, 2021
assisrafael added a commit to assisrafael/react-app-boilerplate that referenced this pull request Jul 14, 2021
assisrafael added a commit to assisrafael/react-app-boilerplate that referenced this pull request Jul 14, 2021
* feat: code splitting and lazy loading with loadable-components

* chore: use alternative webpack loadable plugin to fix generated stats
Check gregberge/loadable-components#778

* refactor: improve ssr renderer abstractions

* chore: clean production build
@stale
Copy link

stale bot commented Jul 26, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

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

Successfully merging this pull request may close these issues.

Missing assets from loadable-stats.json
3 participants