Error compiling template: You ma

2018-07-24  本文已影响0人  Nisus_Liu

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

环境

慕课问题页

我按照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"!

上一篇下一篇

猜你喜欢

热点阅读