Skip to content

Instantly share code, notes, and snippets.

@craigiswayne
Last active June 12, 2021 23:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save craigiswayne/8d72ad807fd7d00af568eaa5f280cec8 to your computer and use it in GitHub Desktop.
Save craigiswayne/8d72ad807fd7d00af568eaa5f280cec8 to your computer and use it in GitHub Desktop.
How to Compile Sass \ Scss via NPM - Simple

How to Setup npm and scss \ sass

npm init
npm install node-sass --save
mkdir -p src/styles
touch src/styles/style.scss

In your generated package.json add the following to your scripts entry

"scripts": {
  "compile:sass": "node-sass src/styles -o dist/styles --source-comments=false --source-map=true --output-style=compressed --error-bell",
  "watch:sass": "npm run compile:sass -- --watch",  
  "watch": "npm run watch:sass"
}

Then to get up and running, just do the following in your command line \ terminal

npm run compile:sass
npm run watch:sass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment