美文网首页
Error compiling template: You ma

Error compiling template: You ma

作者: Nisus_Liu | 来源:发表于2018-07-24 01:07 被阅读0次

    报错说需要对应的loader来处理这类文件, 事实上, 已经安装有对应的loader, 且在webpack.config.js中有正确配置的.

    环境

    • webpack-dev-server@3.1.5
    • webpack@4.16.1
    • vue-loader@15.2.6

    慕课问题页

    我按照GitHub的方法, 将<template lang="html">中的lang="html"删除. 同时, 删除了style中内容. 可以编译成功.

    接下来解决, 怎么让其识别style?

    Try 1:

    ref

    1532363965683.png

    ==> 报没有node-sass模块 ==> 安装npm install node-sass --no-optional ==>

    成功!

    [图片上传失败...(image-dad46b-1532365399855)]

    Try 2:

    //try: 解决style编译问题 failed , 还是得加 lang="scss"
    options: {
        loaders: {
            // Since sass-loader (weirdly) has SCSS as its default parse mode, we map
            // the "scss" and "sass" values for the lang attribute to the right configs here.
            // other preprocessors should work out of the box, no loader config like this necessary.
            'scss': 'vue-style-loader!css-loader!sass-loader',
            'sass': 'vue-style-loader!css-loader!sass-loader?indentedSyntax'
        }
        // other vue-loader options go here
    }
    

    看来, 还是得lang="scss"!

    相关文章

      网友评论

          本文标题:Error compiling template: You ma

          本文链接:https://www.haomeiwen.com/subject/qmwsmftx.html