Compiling Sass Using the node-sass Node Package on a Mac
Posted on March 8, 2016 in Node.js, Sass by Matt Jennings
- First, install Node.js and NPM if you have not already done so.
- Open up Terminal, type in
cd, and press Enter on your keyboard to ensure you are in the root.
- Install the node-sass package in by typing the command below in Terminal:
npm install -g node-sass
- In Terminal, navigate to the directory that holds
.scssfile you want convert to
.css, and enter the command below which would would convert and compress a file named
NOTE: The example below assumes that you have navigatated into a
/wp-content/themes/mytheme/directory. Then the ouputted and compressed
style.cssfile is found at
node-sass --output-style compressed style.scss style.css --watch