猿问

Module parse failed: Unexpected character '#'

项目运行出现该错误提示。
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.

https://img2.mukewang.com/5ca8157d000144fe08000458.jpg



小怪兽爱吃肉
浏览 5719回答 2
2回答

LEATH

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()  ]}

鸿蒙传说

Vue Loader v15 now requires an accompanying webpack plugin to function properly:// webpack.config.jsconst VueLoaderPlugin = require('vue-loader/lib/plugin')module.exports = {  // ...  plugins: [    new VueLoaderPlugin()  ]}
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答