In my nuxt.config.js
file I insert a JS file into my site using the head attribute. I set the src
of the file to an env var (process.env.FILE_URL
) but can't seem to get this working. I am seeing the following behaviour:
nuxt dev
the env var value is injected correctly and the correct file is loaded.nuxt build && nuxt start
the value is not injected and I get undefined
.src
attr to be an immediately executing function which console logs and then returns process.env.FILE_URL
, the console log is the correct value, but the src
is still set to undefined
.Is this something anyone has seen or can help me with? I can't find any documentation about whether this is expected behaviour, or a bug.
<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c2579">#c2579</a>)</em></sub></div>