小白学 VUE 系列之Windows 安装 Sass

vue window下默认都是很难安装上,要买装了一半成功,要么一半又不成功。

sass 安装

安装教程具体查看
https://www.sass.hk/install/

安装流程

  • 1.安装ruby
  • 2.sass安装
gem install sass
gem install compass
  • 3.更新、帮助、版本
//更新sass
gem update sass

//查看sass版本
sass -v

//查看sass帮助
sass -h

命令行编译

=== Input and Output ===================
    --[no-]stdin               Read the stylesheet from stdin.
    --[no-]indented            Use the indented syntax for input from stdin.
-I, --load-path=<PATH>         A path to use when resolving imports.
                               May be passed multiple times.

-s, --style=<NAME>             Output style.
                               [expanded (default), compressed]

    --[no-]charset             Emit a @charset or BOM for CSS with non-ASCII characters.
                               (defaults to on)

    --[no-]error-css           When an error occurs, emit a stylesheet describing it.
                               Defaults to true when compiling to a file.

    --update                   Only compile out-of-date stylesheets.

=== Source Maps ========================
    --[no-]source-map          Whether to generate source maps.
                               (defaults to on)

    --source-map-urls          How to link from source maps to source files.
                               [relative (default), absolute]

    --[no-]embed-sources       Embed source file contents in source maps.
    --[no-]embed-source-map    Embed source map contents in CSS.

=== Other ==============================
    --watch                    Watch stylesheets and recompile when they change.
    --[no-]poll                Manually check for changes rather than using a native watcher.
                               Only valid with --watch.

    --[no-]stop-on-error       Don't compile more files once an error is encountered.
-i, --interactive              Run an interactive SassScript shell.
-c, --[no-]color               Whether to use terminal colors for messages.
    --[no-]unicode             Whether to use Unicode characters for messages.
-q, --[no-]quiet               Don't print warnings.
    --[no-]trace               Print full Dart stack traces for exceptions.
-h, --help                     Print this usage information.
    --version                  Print the version of Dart Sass.

单文件输出

sass input.scss output.css

压缩输出

sass style.scss style.css --style compressed

vue 下安装sass-loader

默认下,由于被墙,所以第一次都会失败,没关系. 设置下淘宝镜像。

npm install -g cnpm --registry=https://registry.npm.taobao.org

然后在项目下面

cnpm install 

即可安装,然后执行

npm run serve

评论区 (0)

没有记录
支持 markdown,图片截图粘贴拖拽都可以自动上传。