Home

Issue: 2230

how to add script in header

[issue link]

I want to import a script in the header, but I can’t success.
En, other question is how to inline this js in the header.
This is my code.
nuxt.config.js:

module.exports = {
  head: {
    title: 'myTitle',
    meta: [
      { charset: 'utf-8' },
      { 'http-equiv': 'pragma', content: 'no-cache' },
      { 'http-equiv': 'cache-control', content: 'no-cache' },
      { 'http-equiv': 'expires', content: '0' },
      { content: 'telephone=no', name: 'format-detection' }
    ],
    script: [
      { src: '~/assets/js/flexible.js' }
    ]
  },
  css: ['~/assets/css/main.css']
}
This question is available on Nuxt.js community (#c1960)