【问题标题】:Angular2-Meteor and materialize-scssAngular2-Meteor 和 materialize-scss
【发布时间】:2016-12-20 20:11:11
【问题描述】:

我已经开始玩urigo/angular2-meteor-base,按照官方教程,现在想测试一个前端 css 框架。经过一番谷歌搜索后,我选择了poetic:materialize-scss,但我在导入 scss 文件时遇到了一些问题。

从官方文档安装:

meteor add fourseven:scss
meteor add poetic:materialize-scss

然后在client/styles/main.scss中导入scss:

@import "{poetic:materialize-scss}/sass/materialize.scss";

在项目文件夹中运行meteor 后出现以下错误:

Errors prevented startup:

While determining active plugins:
error: conflict: two packages included in the app (fourseven:scss and angular2-compilers) are both trying to handle *.scss
error: conflict: two packages included in the app (fourseven:scss and angular2-compilers) are both trying to handle *.sass

所以我尝试删除 fourseven:scss 并再次运行 meteor:

Errors prevented startup:

While processing files with angular2-compilers (for target web.browser):
/client/styles/main.scss: Scss compiler error: 
File to import {poetic:materialize-scss}/sass/materialize.scss not found in file: 
/home/vagrant/Projects/NgMeteor/{}/client/styles/main.scss

这是已安装软件包的列表:

angular2-compilers         0.6.6
autopublish                1.0.7
dispatch:mocha-phantomjs   0.1.9
es5-shim                   4.6.15
hwillson:stub-collections  1.0.3
insecure                   1.0.7
meteor-base                1.0.4
mobile-experience          1.0.4
mongo                      1.1.14
poetic:materialize-scss    1.97.6_1 
practicalmeteor:mocha      2.4.5_6 
reactive-var               1.0.11
shell-server               0.2.1
standard-minifier-css      1.3.2
standard-minifier-js       1.2.1
tracker                    1.1.1 
xolvio:cleaner             0.3.1

不确定我是否从正确的位置导入 scss 文件...有人遇到同样的问题吗?

【问题讨论】:

    标签: meteor materialize angular-meteor


    【解决方案1】:

    我不确定如何包含一个流星包 scss,但我知道如何包含一个 npm 包作为解决方案,您可以通过 npm npm install materialize-css 安装它,然后包含它。似乎位于这里https://github.com/Dogfalo/materialize/blob/master/sass/materialize.scss 所以你应该能够做到 @import "{}/node_modules/materialize/sass/materialize.scss"; 另外,你知道https://github.com/angular/material2 吗?我建议改用它。

    【讨论】:

    • 谢谢@bergben,我会检查material2!
    猜你喜欢
    • 1970-01-01
    • 2017-04-30
    • 2015-07-02
    • 2016-12-18
    • 2015-06-27
    • 2015-09-11
    • 2017-06-13
    • 1970-01-01
    • 2017-03-29
    相关资源
    最近更新 更多