问答详情
源自:2-1 vue-loader+webpack项目配置

按照老师的来出错了

ERROR in ./src/app.vue?vue&type=style&index=0&lang=css Module parse failed: Unexpected character '#' (19:0) You may need an appropriate loader to handle this file type. | | | #test{ |     color:red; | } @ ./src/app.vue 4:0-62出错了了

提问者:慕仰0819696 2018-05-09 22:44

个回答

  • Bee2
    2018-05-16 10:53:22

    其实不按照老师的也可以,你这个是缺少了css-loader,改成以下这样既可运行:

    const Path=require('path');

    const {VueLoaderPlugin}=require('vue-loader')

    module.exports={

    mode:'development',

    entry:Path.join(__dirname,"src/index.js"),

    output:{

    filename:"bundle.js",

    path:Path.join(__dirname,"dist")

    },

    module:{

    rules:[

    {

    test:/\.vue$/,

    loader:"vue-loader",

    exclude:/node_modules/

    },

    {

    test:/\.css$/,

    use:[

    'vue-style-loader',

    'css-loader'

    ]

    }]

    },

    plugins:[

    new VueLoaderPlugin()

    ]

    }


  • 孙小白
    2018-05-10 09:21:25

    注意安装的模块的版本号