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

fix: disable load manifest in dev #1711

Merged
merged 3 commits into from Jul 28, 2022

Conversation

rschristian
Copy link
Member

@rschristian rschristian commented Jul 9, 2022

What kind of change does this PR introduce?

bugfixes

Did you add tests for your changes?

Existing cover

Summary

Closes #1710

Looks like there's a race condition in the generation of the load manifest, where the asset manifest isn't guaranteed to exist yet. It's only been reproduced w/ HMR enabled, so that may be the key factor.

Regardless, this is only used to form preload tags, which is never done in dev. Therefore we can just skip the plugin outside of prod.

Does this PR introduce a breaking change?

I can't imagine anyone is consuming the load manifest themselves in dev, no. It's possible, but would be pretty weird and not really useful.

@rschristian rschristian requested a review from a team as a code owner July 9, 2022 13:19
@changeset-bot
Copy link

changeset-bot bot commented Jul 9, 2022

🦋 Changeset detected

Latest commit: ecdbda1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
preact-cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@@ -146,7 +146,7 @@ async function clientConfig(env) {
'process.env.ADD_SW': env.sw,
'process.env.PRERENDER': env.prerender,
}),
new PushManifestPlugin(),
new PushManifestPlugin(env.isProd),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving this into the prod config seems like a better move at first glance, but renderHTMLPLugin depends on it being ran first so we need to keep it here.

@ForsakenHarmony ForsakenHarmony merged commit 5eb5d00 into master Jul 28, 2022
@ForsakenHarmony ForsakenHarmony deleted the fix/disable-load-manifest-in-dev branch July 28, 2022 18:03
@preact-bot preact-bot mentioned this pull request Jul 28, 2022
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

Successfully merging this pull request may close these issues.

Reloading error sometimes
2 participants