Static GitHub Issues

[2044] How to add a global js file?

prev: for SEO fetch data before render component and set meta details for social sharing links
next: auth middleware with store

How do I add a global js file to the nuxt config?

    module.exports = {
      /*
      ** Global CSS
      */
      css: ['~/assets/css/main.css'],
      /*
      ** Global JS
      */
      js: ['~/assets/js/main.js']
    }

It does not work obviously.

Any ideas?

<!--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/c1813">#c1813</a>)</em></sub></div>