How to import boostrap v5 (js + css) into nuxt.js v2.14 with vue v3 project?

As of today, bootstrap-vue does not support vue v3 and bootstrap v5.

I would like to just import bootstrap files into nuxt v2.14 project. Could anyone give me a specific example how to accomplish this?

Since I just started vue/nuxt a week ago I would appreciate help at this point.

P.S. Emphasis on CSS and JS.


#1 Answers

Add bootstrap 5 css and js files in assets directory under the folder bootstrap after downloading them then configure your nuxt.config.js :

export default {
   ...
     css: ['~/assets/bootstrap/bootstrap.min.css'],
     script: [
      {
        src: "~/assets/bootstrap/bootstrap.bundle.min.js",
        type: "text/javascript"
      }
     ]
    ...
}

Comments