[Vuejs]-Include js library in nuxt.config.js with Assets

0๐Ÿ‘

โœ…

Try Like this and make sure static folder and create js floder inside it and put your jquery-3.4.1.min.js file there. In your nuxt.config.js put :

script: [
  { src: 'js/jquery-3.4.1.min.js' },
]

0๐Ÿ‘

I fixed the issue by adding a new folder called static and I put inside it all js files and then

script: [
      { src: './js/jquery-3.4.1.min.js', type: 'text/javascript' },
    
    ],

0๐Ÿ‘

For "nuxt": "^3.6.5":

Try Like this and make sure public folder and create js folder inside it and put your jquery-3.4.1.min.js file there. In your nuxt.config.js put :

    script: [
      { src: 'js/jquery-3.4.1.min.js' },
    ]

Folder structure screenshot:

enter image description here

Leave a comment