Skip to content

bundle: true does not automatically inject bundled script nor update src, and this is undocumentedΒ #466

Open
@agracia-foticos

Description

@agracia-foticos

πŸ› The bug

When using useScript() with the bundle: true option, the documentation implies that the script will be bundled and served from the local domain automatically β€” but this does not happen.

Instead, the script is still loaded from the original external URL unless the developer manually uses proxy.src and injects their own <script> tag.

This behavior is not mentioned in the documentation and leads to confusion. Developers assume bundle: true will change the src or handle injection automatically (like Nuxt's useHead() or useSeoMeta() do).

πŸ› οΈ To reproduce

https://stackblitz.com/edit/nuxt-starter-invmavzj?file=app.vue

🌈 Expected behavior

Either:

bundle: true should automatically replace the src with the local bundled version, or

The documentation should clearly explain that developers must use proxy.src manually.

ℹ️ Additional context

Add a note to the API docs under bundle explaining that:

"Using bundle: true does not automatically change the script's src. You must use the src returned by useScript() if you want to load the locally bundled version."

Optional: Provide a config like inject: true to automate this behavior (similar to how useHead() works).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions