Can I make zoned apps deploy statics to the same bucket and share identical chunks? #11759
-
I have a scenario similar to this:
All apps:
This already works in Next 9.1, but with the introduction of granular chunks (specially the framework chunk) it means that two or more apps can generate the same exact chunk. Is this a foreseen scenario? Is it safe for an app to use chunks generated by another app? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
You'll want to upload them to separate directories and update assetPrefix accordingly as it's not guaranteed to be safe (and the buildid changes also). |
Beta Was this translation helpful? Give feedback.
-
Thank you @timneutkens for your answer. Adding more details to what @guilhermehn already stated, we share this build configuration between these zoned apps, and we have a custom file-loader setup to extract images and webfonts to the root directory of the exported assets (similar with the expected behavior that the splitted chunks will have, outside of the generated BUILD_ID), in which the extracted file names are based on it's contents So, as an example, the build of two different apps running in zones - using the exact same config - looks something like this (without even upgrading to Next 9.3)
Is there a safe and recommended way of sharing assets between zoned apps (not being with that upload on the same root of a bucket)? Our main goal it's to spare the end user from downloading again those same files as they navigate between different zones. |
Beta Was this translation helpful? Give feedback.
You'll want to upload them to separate directories and update assetPrefix accordingly as it's not guaranteed to be safe (and the buildid changes also).