Node-sass with multiple input files

I use node-sassdirectly from the command line (Makefile, really) to create my CSS.

Scss files are located in different directories and they do not reference each other. I would like these files to be transferred to a single CSS output that I can read from HTML using working source maps.

This is the current command in the Makefile:

$(OUT_MAIN_CSS): $(SCSS) Makefile $(node-sass)
    cat $(SCSS) > $(TMP_SCSS)
    $(node-sass) --output-style compressed --source-map $(OUT_MAIN_CSS).map $(TMP_SCSS) $@
    rm $(TMP_SCSS)

OUT_MAIN_CSS- out/bundle.css. SCSS- list of input files. node-sass- node_modules/.bin/node-sass.

I would like to have a single line and do not need a temporary file. In addition, I would like the links to the source map (for debugging) to lead to the source files, not a temporary file.

node-sass syntax 1

node-sass [options] <input.scss> [output.css]

node-sass . , , .

" " " ", (, , ...).

node -sass 2

cat <input.scss> | node-sass [options] > output.css

Unix. . (out/bundle.css), , node-sass .

, --source-map-root, ...

, ? ?

ring.scss , , ?

+4
2

main Sass, main node -sass? .

+9

index.scss. , . :.

node-sass [options] styles/ [output.css]
0

Source: https://habr.com/ru/post/1589475/


All Articles