Search
Star
Feedback
Setup for Free
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Build script and then inject into <head> - Nuxt
N
Nuxt
•
2y ago
Muse
Build script and then inject into <head>
I have a
.ts
.ts
file that contains an
import
import
statement to use a function from a third
-party package
.
This script needs to be compiled and then loaded as close to the top of the
<head>
<head>
as possible
.
Is there an existing way to do this easily in Nuxt 3
? I
'm also open to other alternatives that are equivalent to loading the script inside
<head>
<head>
without necessarily putting it there
, e
.g
. calling the function inside that
.ts
.ts
file in a hook somewhere
?
This is used for monitoring page performance so the browser agent needs to run as early as possible
.
Nuxt
Join
Nuxt Community Chat Server
31,817
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
Import .env into app{ head{ script{
N
Nuxt / ❓・help
3y ago
Plugins - inject Component & hook into API Request
N
Nuxt / ❓・help
2y ago
Nuxt/kit: when creating a module, how can I inject a script into the body
N
Nuxt / ❓・help
4y ago