简体   繁体   English

如何使用 Live Sass 编译器将所有 scss 编译为 style.css?

[英]How to compile all scss to style.css with Live Sass Compiler?

I have around 50 scss files in folder /scss.我在文件夹 /scss 中有大约 50 个 scss 文件。 When im editing them i need compile it to one style.css with is in root.当我编辑它们时,我需要将它编译成一个 style.css,它位于根目录中。 What exactly i have to add to settings?我到底要添加什么设置?

"liveSassCompile.settings.formats": [
    {
     "format": "expanded",
     "extensionName": "style.css",
     "savePath": "/"
    }
   ],

This not works这不起作用

I need this:我需要这个:

在此处输入图像描述

 "liveSassCompile.settings.formats":[
    // This is Default.
    {
        "format": "expanded",
        "extensionName": ".css",
        "savePath": null
    },
    // You can add more
    {
        "format": "compressed",
        "extensionName": ".min.css",
        "savePath": "/dist/css"
    },
    // More Complex
    {
        "format": "compressed",
        "extensionName": ".min.css",
        "savePath": "~/../css/"
    }
]

The extension is not a packing tool.扩展程序不是打包工具。 You need a style.scss file that imports all of your files.您需要一个style.scss文件来导入所有文件。 Something like the below类似下面的东西

@import './path/file1.scss';
@import './path/file2.scss';
@import './path/file3.scss';

Alternatively, see if webpack can be used或者,看看是否可以使用webpack

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM