Skip to content

Instantly share code, notes, and snippets.

@ponsuke0531
Last active July 10, 2017 11:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ponsuke0531/a0d6b44d33e03e21aeea21279b35112f to your computer and use it in GitHub Desktop.
Save ponsuke0531/a0d6b44d33e03e21aeea21279b35112f to your computer and use it in GitHub Desktop.
SASS初心者がSASSコマンドでSASSファイルを監視する時に知っておいたほうがいいこと ref: http://qiita.com/ponsuke0531/items/b749daaf3e2316ef9e7f
$ sass {sassのファイル名}:{cssのファイル名}
$ cd {FirstSass/sass/までのパス}
$ sass style.scss:./../css/style.css
sass --watch sass:css
>>> Sass is watching for changes. Press Ctrl-C to stop.
error sass/style.scss (Line 1: Invalid UTF-8 character "\x93")
$ sass --watch --default-encoding {文字コード} {スタイルの種類} {sassのファイル名orディレクトリ名}:{cssのファイル名orディレクトリ名}
$ sass --watch --default-encoding US-ASCII sass:css
>>> Sass is watching for changes. Press Ctrl-C to stop.
>>> Change detected to: sass/style.scss
error sass/style.scss (Line 1: Invalid US-ASCII character "\xE6") <----- 「/* 日本語 */」がだめと言われました。消すと無事コンパイルされます。
>>> Change detected to: sass/style.scss
write css/style.css
write css/style.css.map
$ nkf -g css/style.cssss
ASCII
$ sass --watch --default-encoding utf-8 sass:css
>>> Sass is watching for changes. Press Ctrl-C to stop.
>>> Change detected to: sass/style.scss
write css/style.css
write css/style.css.map
$ nkf -g css/style.css
ASCII <---------------------- おっと「/* 日本語 */」がないと「ASCII」に・・・このあと追記してコンパイルします。
$ sass --watch --default-encoding utf-8 sass:css
>>> Sass is watching for changes. Press Ctrl-C to stop.
write css/style.css
write css/style.css.map
$ nkf -g css/style.css
UTF-8
$ sass --watch --unix-newlines {スタイルの種類} {sassのファイル名orディレクトリ名}:{cssのファイル名orディレクトリ名}
$ sass --watch sass:css
>>> Sass is watching for changes. Press Ctrl-C to stop.
>>> Change detected to: sass/style.scss
write css/style.css
write css/style.css.map
バッチ ジョブを終了しますか (Y/N)? y
sass --watch --unix-newlines sass:css
>>> Sass is watching for changes. Press Ctrl-C to stop.
>>> Change detected to: sass/style.scss
write css/style.css
write css/style.css.map
バッチ ジョブを終了しますか (Y/N)? y
$ sass --watch {sassのファイル名orディレクトリ名}:{cssのファイル名orディレクトリ名}
$ cd {FirstSass/までのパス}
$ sass --watch sass:css
>>> Sass is watching for changes. Press Ctrl-C to stop.
>>> Change detected to: sass/style.scss <------- 保存を検知
write css/style.css
write css/style.css.map
>>> Change detected to: sass/style.scss <------- 保存を検知
write css/style.css
write css/style.css.map
>>> Change detected to: sass/style.scss <------- 保存を検知
write css/style.css
write css/style.css.map
$ sass --watch --no-cache {sassのファイル名orディレクトリ名}:{cssのファイル名orディレクトリ名}
$ cd {FirstSass/までのパス}
$ sass --watch --no-cache sass:css
>>> Sass is watching for changes. Press Ctrl-C to stop.
>>> Change detected to: sass/style.scss
write css/style.css
write css/style.css.map
$ sass --watch --sourcemap=none {sassのファイル名orディレクトリ名}:{cssのファイル名orディレクトリ名}
$ sass --watch --sourcemap=none sass:css
>>> Sass is watching for changes. Press Ctrl-C to stop.
>>> Change detected to: sass/style.scss
write css/style.css <---- CSSだけ
$ sass --watch --style {スタイルの種類} {sassのファイル名orディレクトリ名}:{cssのファイル名orディレクトリ名}
$ sass --watch --style expanded sass:css
>>> Sass is watching for changes. Press Ctrl-C to stop.
>>> Change detected to: sass/style.scss
write css/style.css
write css/style.css.map
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment