在添加/集成Vuetify时出错,例如从main.js中的'vuetify / lib'Vue.use(Vuetify)导入Vuetify
错误:
ERROR in ./node_modules/vuetify/src/stylus/components/_grid.styl
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| . @import '../bootstrap'
main.js
import Vuetify from 'vuetify/lib'
Vue.use(Vuetify)
答案 0 :(得分:0)
我们需要像
一样在webpack(webpack.config.js或webpack.js或webpack.base.js)中配置加载程序webpack.base.js
.......other config
module: {
rules: [
{
test: /\.styl$/,
loader: ['css-loader', 'stylus-loader']
},
.....other loaders
]
}
....other config
安装装载机
npm i stylus-loader css-loader --save-dev
答案 1 :(得分:0)
这对我有用。 您可以将其添加到您的角色中。
{
test: /\.styl$/,
loader: ['style-loader', 'css-loader', 'stylus-loader']
},
谢谢