gpt4 book ai didi

css - cloud9 网络编辑器的 scss 构建器

转载 作者:太空宇宙 更新时间:2023-11-04 11:54:43 25 4
gpt4 key购买 nike

你好 :) 我正在尝试弄清楚如何为 cloud9 制作一个 scss 构建器。我只能在 stackoverflow 上以更低的价格找到一些东西。

我正在尝试将我的 scss 文件夹中的 main.scss 编译为同一级别的 css 文件夹中的 main.css。

build 者:

{
"caption" : "SCSS",
"cmd": ["scss", "$file", "-x", "${file/\\.scss/\\.css/}"],
"selector": "source.scss"
}

错误:

OptionParser::InvalidOption:无效选项:-x
使用 --trace 进行回溯。

最佳答案

我认为您使用 Cloud9 构建器的方式是正确的,但是,我在 scss 中找不到 -x 选项。这是 scss -h 给我的:

Usage: scss [options] [INPUT] [OUTPUT]

Description:
Converts SCSS or Sass files to CSS.

Common Options:
-I, --load-path PATH Specify a Sass import path.
-r, --require LIB Require a Ruby library before running Sass.
--compass Make Compass imports available and load project configuration.
-t, --style NAME Output style. Can be nested (default), compact, compressed, or expanded.
-?, -h, --help Show this help message.
-v, --version Print the Sass version.

Watching and Updating:
--watch Watch files or directories for changes.
The location of the generated CSS can be set using a colon:
scss --watch input.scss:output.css
scss --watch input-dir:output-dir
--poll Check for file changes manually, rather than relying on the OS.
Only meaningful for --watch.
--update Compile files or directories to CSS.
Locations are set like --watch.
-f, --force Recompile every Sass file, even if the CSS file is newer.
Only meaningful for --update.
--stop-on-error If a file fails to compile, exit immediately.
Only meaningful for --watch and --update.

Input and Output:
--sass Use the indented Sass syntax.
--sourcemap=TYPE How to link generated output to the source files.
auto (default): relative paths where possible, file URIs elsewhere
file: always absolute file URIs
inline: include the source text in the sourcemap
none: no sourcemaps
-s, --stdin Read input from standard input instead of an input file.
This is the default if no input file is specified.
-E, --default-encoding ENCODING Specify the default encoding for input files.
--unix-newlines Use Unix-style newlines in written files.
Always true on Unix.
-g, --debug-info Emit output that can be used by the FireSass Firebug plugin.
-l, --line-numbers Emit comments in the generated CSS indicating the corresponding source line.
--line-comments

Miscellaneous:
-i, --interactive Run an interactive SassScript shell.
-c, --check Just check syntax, don't evaluate.
--precision NUMBER_OF_DIGITS How many digits of precision to use when outputting decimal numbers.
Defaults to 5.
--cache-location PATH The path to save parsed Sass files. Defaults to .sass-cache.
-C, --no-cache Don't cache parsed Sass files.
--trace Show a full Ruby stack trace on error.
-q, --quiet Silence warnings and status messages during compilation.

这里有一些对您有用的东西:

{
"cmd" : ["scss", "$file", "$file_path/../css/$file_base_name.css"],
"info" : "Building $file_path/$file_name",
"selector": "source.scss"
}

$file 是完整路径,$file_path 是目录路径,$file_base_name 是不带后缀的文件名扩大。您可以看看其他可用的变量here .

关于css - cloud9 网络编辑器的 scss 构建器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30345109/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com