How to change webpack chunk priority in the browser?

Viewed 243

i'm using laravel-mix@^6 and webpack@^5, and i'm using dynamic imports to create chunks like so :

Vue.component('my-component', () => import(/* webpackChunkName: 'myComponentChunk' */ '@/components/MyComponent'));

i'm also using laravel-mix export method to create chunks for individual packages when they are heavy.

it is working fine, the only issue i have is the chunk priority in the browser when they are loaded.

enter image description here

This low priority cause a delay in the loading of the page, since it will wait for those chunks.

for now i'm adding a script tag in the head to force the chunk to be loaded with high priority but it's not very practical, since i often forget a chunk and the problem occur again.

i you have any idea why it does that.

thanks.

0 Answers
Related