In examples like this we have the v-html directive to dynamically render the raw html into the dom. I am in need of a way to insert a raw script before the entire lifecycle begins its magic. This is because I am working with a macro (auth0).
<!doctype html> <html lang="en" data-n-head="..."> <head>...nuxt generated head...</head> <script> // this tag needs to exist as html when building with 'yarn generate' // @@config@@ is a macro let config = JSON.parse(decodeURIComponent(escape(window.atob('@@config@@')))); </script> <body> ... nuxt generated body ... </body>
In essence, when I run the command
yarn generate I would like a specific page (
pages/login/index.html) to have this specific tag to exist and not injected during vue's lifecycle. There are alternate solutions like having scripts automatically postprocessing the static page output, but I'm hoping that there is a way to accomplish this without such complications.
My nuxt version is