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

SSR pages are not have resource plugin optimization lifecycles applied #1363

Closed
thescientist13 opened this issue Dec 27, 2024 · 0 comments · Fixed by #1364
Closed

SSR pages are not have resource plugin optimization lifecycles applied #1363

thescientist13 opened this issue Dec 27, 2024 · 0 comments · Fixed by #1364
Assignees
Milestone

Comments

@thescientist13
Copy link
Member

Type of Change

Bug

Summary

As observed in thescientist13/HP_Stuff#1, it was reproduced that in the case where there is a plugin that runs an shouldOptimize / optimize resource plugin on HTML, these will not get honored in the generated HTML for SSR pages. For example, the active content plugin needs to add some "setup" <script> tags specifically for production builds
thescientist13/HP_Stuff#1

And here we can see the related client side code failing since the expected optimized HTML is not there
Screenshot 2024-12-27 at 1 41 40 PM
Screenshot 2024-12-27 at 5 38 53 PM

Details

Looking at the code, it seems pretty obvious what the issue is, we never honor any resource plugins other than Greenwood's internal plugin. 😬
https://github.com/ProjectEvergreen/greenwood/blob/v0.31.0-alpha.1/packages/cli/src/lifecycles/bundle.js#L291

Which definitely seems like an oversight I suppose since we do honor all resource plugins for intercepting 🤦‍♂️
https://github.com/ProjectEvergreen/greenwood/blob/v0.31.0-alpha.1/packages/cli/src/lifecycles/bundle.js#L272

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
1 participant