Home

Issue: 2437

Loading Async/Defer some external resources JS?

[issue link]

I am importing a external JS file (google map) as external resource, as defined in the documentation
https://nuxtjs.org/faq/

It is working fine.

But if I test my deployed page on Google Speed Insight, it warns me I got some JS loading time to improve for this file: “Your page has 1 blocking script resources. This causes a delay in rendering your page.”

Usually I know how to solve the problem: adding an “async” or “defer” to an external js file loaded.
But now with the Nuxt logic I am not sure if it possible.

Question: in Nuxt could I set to load js external resources as “async” or “defer” ? Is this the right approach to solve performance issue?

This question is available on Nuxt.js community (#c2113)