I have a custom script that I want to include in my nuxt project.
The thing is, this script needs to be included before the dom loads. It contains overrides for this particular project.
My assets folder is structured with a scripts subfolder:
In my nuxt.config.js file I've got this:
export default {
css: ["~/assets/css/main.scss"],
head: {
script: [
{
src: "https://cdnjs.cloudflare.com/ajax/libs/aframe/1.0.4/aframe.min.js",
src: "_nuxt/assets/scripts/bundle.js", // this is the script that I'm trying to include
},
I added the _nuxt/ after looking at how some of the other assets are being successfully included
All of the stuff we need to happen before the dom is loaded is already bundled up in the file and, even though it's unconventional, this would work if we could get it to load.
I've looked through the nuxt docs about the head property either in this config or in the actual .vue files, but it talks about external resources and not those local to the project.
How would I properly include this file in the head within nuxt?
Also, if there's a proper way of bundling the source code for this bundle separate from the main nuxt js code so that it can pass through nuxt/tsc properly I'm def open to it.


