Why islands scripts are pushed to opts.imports? #747
-
Hi, I would like to understand because there are performance improvements about how scripts are loaded. Currently, the script have more importance than LCP images. The scripts download, parse and execute blocking the render. Maybe, they could be loaded as Current: Removing scripts from |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
To preload them. Not all browsers support |
Beta Was this translation helpful? Give feedback.
-
Ok! We could add the defer attribute on these scripts to not block the HTML parser: https://v8.dev/features/modules#defer What do you think? Also add an option to use preloads instead imports. |
Beta Was this translation helpful? Give feedback.
-
If you look at the waterfall in DevTools you should notice that the script tags are not actually blocking anything. They just show up first in the network panel because the requests are sent off first (because they are encountered by the HTML parser first). |
Beta Was this translation helpful? Give feedback.
If you look at the waterfall in DevTools you should notice that the script tags are not actually blocking anything. They just show up first in the network panel because the requests are sent off first (because they are encountered by the HTML parser first).