美文网首页我爱编程
Angular2 - Angular-CLI SASS opti

Angular2 - Angular-CLI SASS opti

作者: 飞鱼YE | 来源:发表于2017-04-21 17:15 被阅读0次

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"

],

相关文章

网友评论

    本文标题:Angular2 - Angular-CLI SASS opti

    本文链接:https://www.haomeiwen.com/subject/uthxpttx.html