Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
通过windows命令行将SCSS文件批量编译为CSS_Css_Sass_Compilation - Fatal编程技术网

通过windows命令行将SCSS文件批量编译为CSS

通过windows命令行将SCSS文件批量编译为CSS,css,sass,compilation,Css,Sass,Compilation,我想知道,如何通过windows命令行批量编译SCSS文件……在旧版本中,命令“sass--watch scssFolder:CSSFolder”可以完成这项工作,但在最新版本的sass中,它似乎已经过时了。sass watch在darts版本中暂时没有实现,以编译您可以使用的.SCSS文件 sass filename.scss filename.css 如果您愿意,您仍然可以使用ruby版本,但它很快就会过时。您用于sass节点模块的方法在最新版本中已被弃用,因此您有两个(或更多)选项: 选

我想知道,如何通过windows命令行批量编译SCSS文件……在旧版本中,命令“sass--watch scssFolder:CSSFolder”可以完成这项工作,但在最新版本的sass中,它似乎已经过时了。

sass watch在darts版本中暂时没有实现,以编译您可以使用的.SCSS文件

sass filename.scss filename.css

如果您愿意,您仍然可以使用ruby版本,但它很快就会过时。

您用于
sass
节点模块的方法在最新版本中已被弃用,因此您有两个(或更多)选项:

选项1:使用节点sass

这是一个省力的选择。您已经安装了Node.js(和npm),因此可以安装运行
npm install-g Node sass
的编译器。完成所有安装后,您将能够查看或编译整个文件夹(或单个文件)

节点sass input.scss output.css
将编译单个文件

节点sass输入/文件夹-o输出/文件夹
将编译整个文件夹

使用
-w
选项,您可以查看文件夹:

sass --update path/to/input/folder:path/to/output/folder
sass --watch path/to/input/folder:path/to/output/folder
节点sass-w input/folder-o output/folder
将监视文件夹并将文件编译到output文件夹

只需运行
节点sass--help
即可获得完整的选项列表

选项2:使用Ruby SASS

您需要通过运行以下命令行来安装和安装。所有安装完成后,您将能够
查看
更新
(编译)整个文件夹(或单个文件)

update
将编译文件夹中的单个文件或多个文件(取决于参数)
watch
将执行相同的操作,初始编译完成后,它将监视指定文件夹中的文件或所有文件,因此每次检测到任何目标文件上的更改时,
sass
将编译更改的文件

两个选项具有相同的命令行sintax:

sass --watch input/folder:output/folder
sass --watch input.scss:output.css
因此,要编译文件夹中的所有文件:

sass --update path/to/input/folder:path/to/output/folder
sass --watch path/to/input/folder:path/to/output/folder
要编译并查看文件夹,请执行以下操作:

sass --update path/to/input/folder:path/to/output/folder
sass --watch path/to/input/folder:path/to/output/folder
只需运行
sass--help
,即可获得完整的选项列表


希望有帮助

但据我所知,你提到的命令只能编译一个文件,我打算编译引导的scss文件夹的全部内容。@ahmad oh抱歉!您是否尝试用文件夹名称替换文件名?这不起作用。建议的sintax仅用于单文件编译。@muecas好的,所以ahmad如果你想使用sass,你必须使用ruby版本——watch对于window没有其他的
sass
命令,只有ruby Gem.TNX@muecas中的命令供你回复。但据我所知,在最新版本的SASS中没有用于批量编译文件夹的命令,或者至少我还没有找到。如果有plz,请告诉我。@ahmad我安装最新版本只是为了测试它,它工作了。Ruby 2.5.1和Gem Sass 3.5.6。让我们明确一点:如果我想批量编译,我必须在我的机器上安装Ruby,否则就不可能批量编译文件夹。。。我说的对吗?!没有ruby你甚至不能运行sass!至少是包含您提到的选项的版本。您可以运行其他版本,例如节点ja的版本。你在运行哪个版本?我用bower安装了SASS。。。我正在使用的SASS版本是(使用dart2js 2.0.0-dev.50.0编译的1.3.0)。没有额外的安装在我的机器上,我只能通过windows命令行批量编译单个文件。。。