I’m having trouble loading bootstrap-js

Asked

Viewed 206 times

2

import Vue from 'vue' 
import App from './App.vue'
import BootstrapVue from 'bootstrap-vue' 
import 'bootstrap/dist/css/bootstrap.css'
import 'bootstrap-vue/dist/bootstrap-      
vue.css'
 Vue.use(BootstrapVue);
 new Vue({ el: '#app',
 render: h => h(App) })

ERROR in . /~/bootstrap-Vue/dist/bootstrap-Vue.css Module parse failed:
C: Users Batip Desktop project-test myproject node_modules bootstrap-Vue dist bootstrap-Vue.css
Unexpected token (1:0) You may need an appropriate Loader to Handle this file type.

  • You have the Loader style in the webpack loaders? {
 test: /\.css$/,
 loader: 'style-loader!css-loader'
 },

  • Hello Monk, I would recommend using bootstrap through CDN even the build gets lighter and the site faster

1 answer

1


Junta in the webpack.config.js the respective download, along with what you should already have to compile the files .vue:

{
    test: /\.vue$/,
    loader: 'vue-loader'
},
{
    test: /\.css$/,
    loader: 'style-loader!css-loader'
},

That implies you must have the css-loader and the vue-loader no package.json, installed.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.