-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
PR discussion: Incremental Builds by adding additional hooks #10148
Comments
Hi @HelloAlexPan. You can actually disable payload versioning but also ensure that export default {
// Generates assets to `_nuxt/static/_/path/of/route/payload.js`
generate: { staticAssets: { version: '_' } }
} |
Hey @pi0, thanks for that suggestion. I was wondering if you could lend me your time so I could discuss the following two points with you: Your proposed solution removes the timestamp. However, without it the user cannot get the correct version. With versioning, we can ensure that the user always gets the correct Additionally, disabling payload versioning is an undocumented approach and without documentation, the community can't be confident that it is safe to use. By adding hooks, this has very minimal influence on the core structure of nuxt, whilst solving both issues above. Would you like us to open our PR so you can look into our proposed solution in more detail? |
PR for adding hook certainly welcome and nice addition! But I'm afraid it is no more official than an undocumented workaround with hooks. We could add a built-in generate option as well simply moving version from path to a query parameter. (runtime code also needs this in several places) |
Awesome, thanks @pi0 done! Would love to hear more about the built in generate option as well — what we do would be heavily influenced by this and we'd love to help out where we can |
We are approaching the Nuxt 2 EOL date (June 30, 2024) - see this article for more information. I'm closing this issue as it's marked as a Nuxt 2 related enhancement and it's not a critical issue. That doesn't mean it might not be relevant for Nuxt 3. If it is, please feel free to open a new issue (or just comment, and I can reopen it). 🙏 Thank you for your understanding and for your contribution to Nuxt! 🎉 |
Many people running the JAMstack on large sites require faster builds.
However, in Nuxt 2, currently the static site directory structure is not compatible with incremental builds as it contains the timestamp in the pathname of URL, e.g.:
The path is hardcoded in
vue-renderer
.To implement incremental builds, the user needs to change it to a more friendly format:
Describe the solution you'd like
We've already created a solution to this that we want to PR, where we add hooks so that users can modify
payloadPath
andpayloadUrl
And as well as the path for
state.js
Would love any feedback from the community before we make the PR!
The text was updated successfully, but these errors were encountered: