我已经使用webpack创建了vue应用,现在我将vue与boostrap-sass集成在一起,但是语法错误出现了,我只是不明白为什么
以下是我的文件夹结构
router-app
src
assets
scss
styles.scss
node_modules
bootstrap-sass
assets
stylesheets
Bootstrap Folder
_bootstrap.scss
这是Vue抛出的错误
ERROR Failed to compile with 1 errors 14:10:35
error in ./src/main.js
Syntax Error: Unexpected token, expected ( (3:8)
1 | // The Vue build version to load with the `import` command
2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
> 3 | @import 'assets/scss/styles.css'; //here's the issue
| ^
4 | import Vue from 'vue'
5 | import App from './App'
6 | import router from './router'
@ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.js
在我的styles.scss中,
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/variables";
@import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap";
任何人都可以让我知道我是走正确的道路还是哪里出错了,我们将不胜感激
答案 0 :(得分:0)
我过得如何
1. in ur node module folder install bootstrap not bootstrap-sass
2。in main.js
import './assets/scss/styles.css'; //point to the folder where ur scss and css sass files r kept
3。指向scc bootstrap.scss文件`
@import "../../../node_modules/bootstrap/scss/bootstrap";`
编译文件
注意-我没有加载程序来对其进行Web配置,不需要任何操作
和您的欢呼声:)