Closed Jordaneisenburger closed 1 month ago
Hi @Jordaneisenburger. Thank you for your report. To help us process this issue please make sure that you provided sufficient information.
Please, add a comment to assign the issue: @magento I am working on this
@magento I am working on this
@magento export issue to JIRA project PWA as Story
:white_check_mark: Jira issue https://jira.corp.magento.com/browse/PWA-2414 is successfully created for this GitHub issue.
hello @Jordaneisenburger could you send your diff for this feature I want to move the code of my custom vendor into a standalone bundle/chunk
hello @Jordaneisenburger could you send your diff for this feature I want to move the code of my custom vendor into a standalone bundle/chunk
Something like below @vvendor/kernel/lib/intercept.js
const builtins = targets.of('@magento/pwa-buildpack');
builtins.webpackCompiler.tap(compiler => {
const cacheGroups = compiler?.options?.optimization?.splitChunks?.cacheGroups;
if (cacheGroups && typeof cacheGroups.vvendor === 'undefined') {
cacheGroups.vvendor = {
test: /[\/]node_modules[\/](@vvendor)[\/]/,
reuseExistingChunk: true,
name: 'vvendor',
};
}
});
@0m3r Are your way help to reduce the vendor bundle size?
@huykon yes it worked for me in June, but I didn't test it in the latest version(s)
@0m3r I tried your way but it doesn't reduce much size, do you have any others way?
@adobe export issue to Jira project PWA
:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/PWA-3280 is successfully created for this GitHub issue.
Is your feature request related to a problem? Please describe. For a PWA Studio developer using the scaffolder to kickstart their project we'd expect them to build custom code ontop of the scaffolded app meaning that the functionalities that change a lot will be their own local code instead of
node_modules
.What happens right now is that we on buildtime we create a
client.js
bundle that holds local code but also@magento
packages. Tese packages would add an extra x kb to the client.js bundle that needs to download everytime when some local code changes even when the@magento
packages did not change.Ideally we split
@magento
packages into it's own bundle so that the browser can have it in cache for longer periods of time and it doesnt have to redownload between local changes and will for example only change whenever the store is being upgraded to a newer version of PWA Studio meaning we have longer cache validity.Describe the solution you'd like Split
@magento
packages into their own bundle via webpack cacheGroups.Additional context Before change to webpack:
After change to webpack:
Benefits:
Definetly not a subject expert so would love to hear anyones feedback/opinions!
Please let us know what packages this feature is in regards to:
venia-concept
venia-ui
pwa-buildpack
peregrine
pwa-devdocs
upward-js
upward-spec
create-pwa