How to prevent SASS from merging files included vi

2019-02-26 00:48发布

Is it possible to prevent SASS from merging files included via @import?

For development, i would like to maintain the references of the original CSS (in my setup compiled from SASS already).

标签: css import sass
1条回答
Summer. ? 凉城
2楼-- · 2019-02-26 01:29

The docs for the @import rule says that:

All imported SCSS and Sass files will be merged together into a single CSS output file.

And explain that there is some circumstances under which it will compile to a CSS @import rule:

  • If the file's extension is .css.
  • If the filename begins with http://.
  • If the filename is a url().
  • If the @import has any media queries.

The following rules will tell SASS to merge imported files:

@import "foo.scss";
@import "foo";

The following rules will tell SASS to NOT merge imported files:

@import "foo.css";
@import "foo" screen;
@import "http://foo.com/bar";
@import url(foo);
查看更多
登录 后发表回答