项目运行出现该错误提示。ERROR in ./src/App.vue?vue&type=style&index=0&lang=cssModule parse failed: Unexpected character '#' (26:0)You may need an appropriate loader to handle this file type.
2 回答
LEATH
TA贡献1936条经验 获得超6个赞
vue-loader@15.*之后除了必须带有VueLoaderPlugin 之外,还需另外单独配置css-loader。
const VueLoaderPlugin = require('vue-loader/lib/plugin')
module.exports = {
// ...
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader'
},
{
test: /\.css$/,
use: ['style-loader','css-loader']
}
]
}
plugins: [
new VueLoaderPlugin()
]
}
鸿蒙传说
TA贡献1865条经验 获得超7个赞
Vue Loader v15 now requires an accompanying webpack plugin to function properly:
// webpack.config.js
const VueLoaderPlugin = require('vue-loader/lib/plugin')
module.exports = {
// ...
plugins: [
new VueLoaderPlugin()
]
}
添加回答
举报
0/150
提交
取消