Dart是否与SASS集成在一起? [英] Is Dart integrated with SASS?

查看:158
本文介绍了Dart是否与SASS集成在一起?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在最终与AngularDart(2.0)变得更加亲密之后,我决定将SASS加入到关系中。看来SASS开发人员也正在向Dart求助,向Sart求助(两个月前)。

After finally becoming more intimate with AngularDart (2.0), I decided to throw SASS into the relationship. It appears the SASS devs are also coming over to Dart SASS to Dart (two months ago).

知道, @Component(styleUrls:'style.sass')似乎无法识别 .sass .scss 扩展名。在时间轴上是否有任何知识或更新或对兼容性的期望?地狱,甚至是SASS的Dart酒馆(我觉得后者可能在这里,但我掩饰了它)。

Knowing that, the @Component( styleUrls: 'style.sass') doesn't appear to recognize the .sass or .scss extensions. Is there any knowledge or update on a timeline or expectancy to compatibility? Hell, maybe even a Dart pub for SASS (I feel like the latter might be here, but I glossed over it).

推荐答案

Dart 2
在具有 build_runner 的Dart 2中,只需添加

Dart 2 In Dart 2 with build_runner just add

dev_dependencies:
  sass_builder: ^1.1.2

pubspec.yaml

Dart 1

改用

@Component( styleUrls: 'style.css')

,然后在您的 pubspec.yaml

https://pub.dartlang.org/packages/dart_sass_transformer

dependencies:
  dart_sass_transformer: ^0.5.0
transformers:
  - dart_sass_transformer:

然后 style.sass style.scss 将自动转换为 style.css 并提供给Angular组件

then style.sass or style.scss will automatically be transformed to style.css and made available to Angular components

您需要运行 pub get --packages-dir 直到 https://github.com/sass/dart-sass/pull/53 可用。

这篇关于Dart是否与SASS集成在一起?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆