The output file name is wrong when I run a command which also sets the options to generate a source map.
My command:
node-sass \
-o /home/user/public_html/css \
--output-style compressed \
--source-map /home/user/public_html/css/bar.min.css.map \
/home/user/public_html/css/src/foo.scss > /home/user/public_html/css/bar.min.css
Command output:
Rendering Complete, saving .css file...
Wrote CSS to /home/user/public_html/css/foo.css
Wrote Source Map to /home/user/public_html/css/bar.min.css.map
Problem:
npm -v): 3.10.10node -v): v6.10.2node -p process.versions):node -p process.platform): linuxnode -p process.arch): x64node -p "require('node-sass').info -g"):npm ls node-sass -g):By supplying the --output (-o) flag you have told node-sass to save the compiled output to that directory with the input file name.
The reason a blank file was created is because you've piped the empty output to bar.min.css.map.
If you want to control the output filename then shouldn't used the --output flag, but instead pipe the output the desired location.
node-sass \
--output-style compressed \
--source-map /home/user/public_html/css/bar.min.css.map \
/home/user/public_html/css/src/foo.scss > /home/user/public_html/css/bar.min.css
absolutely fixed the problem! thanks bro.
By supplying the
--output(-o) flag you have told node-sass to save the compiled output to that directory with the input file name.The reason a blank file was created is because you've piped the empty output to
bar.min.css.map.If you want to control the output filename then shouldn't used the
--outputflag, but instead pipe the output the desired location.node-sass \ --output-style compressed \ --source-map /home/user/public_html/css/bar.min.css.map \ /home/user/public_html/css/src/foo.scss > /home/user/public_html/css/bar.min.css
absolutely fixed the problem! thanks bro.
Most helpful comment
By supplying the
--output(-o) flag you have told node-sass to save the compiled output to that directory with the input file name.The reason a blank file was created is because you've piped the empty output to
bar.min.css.map.If you want to control the output filename then shouldn't used the
--outputflag, but instead pipe the output the desired location.