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\projeto-teste\myproject\node_modules\bootstrap-vue\dist\bootstrap-vue.css
Unexpected token (1:0) You may need an appropriate loader to handle this file type.

2
  • Tens o style loader nos loaders do webpack? { test: /\.css$/, loader: 'style-loader!css-loader' },
    – Sergio
    14/09/2017 às 20:28
  • Olá marcelo, eu recomendaria utilizar o bootstrap através do CDN mesmo a build fica mais leve e o site mais rápido 15/09/2017 às 16:10

1 Resposta 1

1

Junta no webpack.config.js o loader respectivo, juntamente com o que já deves ter para compilar os ficheiros .vue:

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

Isso implica que deves ter o css-loader e o vue-loader no package.json, instalados.

1

Você deve fazer log-in para responder a esta pergunta.

Esta não é a resposta que você está procurando? Pesquise outras perguntas com a tag .