加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

angularjs – sass-loader的CSS错误无效

发布时间:2020-12-17 06:57:54 所属栏目:安全 来源:网络整理
导读:我的app.scss .tes { color: red;} 执行./node_modules/.bin/webpack时输出错误 ERROR in ./~/css-loader!./~/sass-loader?indentedSyntax!./www/assets/app.scssModule build failed: .tes { ^ Invalid CSS after ".tes {": expected "}",was "{" in ./www/
我的app.scss

.tes {
    color: red;
}

执行./node_modules/.bin/webpack时输出错误

ERROR in ./~/css-loader!./~/sass-loader?indentedSyntax!./www/assets/app.scss
Module build failed: 
.tes {
     ^
      Invalid CSS after ".tes {": expected "}",was "{"
      in ./www/assets/app.scss (line 1,column 7)
 @ ./www/assets/app.scss 4:14-135 13:2-17:4 13:2-17:4 14:20-141

我的webpack.config

module: {
        loaders: [
            {
                test: /.scss$/,loader: 'style!css!sass?indentedSyntax'
            },{
                test: /.css$/,loader: 'style!css'
            },{
                test: /.(woff|woff2|ttf|eot|svg)(?]?.*)?$/,loader: 'file-loader?name=res/[name].[ext]?[hash]'
            }
        ]
    },

还有我的app.js

require('./www/assets/app.scss');

var angular = require('angular');
var uiRouter = require('angular-ui-router');
require('velocity-animate');
require('node-lumx');

var HomeController = require('./www/components/home/homeController');

angular.module('app',['lumx',uiRouter]) 
... //OMITED

解决方法

尝试使用sass loader而不使用“indentedSyntax”选项作为’style!css!sass’

更多信息,你可以在这里阅读文档:http://sass-lang.com/documentation/file.INDENTED_SYNTAX.html

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读