Angular2 - Angular-CLI SASS options

When you are creating your project with angular cli try this:

ng new My_New_Project --style=sass

This generating all your components with predifined sass files.

If you want scss syntax create your project with :

ng new My_New_Project --style=scss

Cli handles the rest of it.

Angular-cli also adds an option to change the default css preprocessor after the project has been created by using the command:

ng set defaults.styleExt scss

which was fixed by changing the lines ofangular-cli.json,

"styles": [

"styles.css"

],

to

"styles": [

"styles.sass"

],

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 中文翻译 ng help ng build 构建您的应用程序并将其放入输出路径(dist /默认情况下)。 别名:...
    4ea0af17fd67阅读 2,062评论 0 0
  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 9,921评论 0 23
  • 念从前的日子慢 ——纪念赶马车的叔叔 春来鼠去风尚寒, 抚今追昔泪满衫。 一院狼藉魂归去, 马车牛行从前慢。 念去...
    一枚冰儿阅读 514评论 1 0
  • 5月9日晚九点半,和从前一样下班回家后开始给狗狗冲调奶糕。饭毕,由于妈妈要拖地,我就带着狗狗先下楼溜达,顺便给她买...
    小毛驴简书阅读 394评论 0 3
  • 和群里的仙女们讨论什么事情或者小物能够提升幸福感,以下是我们的分享集合。 小物 1. 电动牙刷。解放双手的选择,我...
    小乔分享记阅读 602评论 3 6