vue项目运行出现该错误提示
ERROR in ./src/App.vue?vue&type=style&index=0&lang=css
Module parse failed: Unexpected character '#' (26:0)
You may need an appropriate loader to handle this file type.
解决
vue-loader@15.*之后必须带有VueLoaderPlugin 并单独配置css-loader。
const VueLoaderPlugin = require('vue-loader/lib/plugin')
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()
]
}