Skip to content

Instantly share code, notes, and snippets.

@benabraham
Created December 9, 2019 17:58
Show Gist options
  • Select an option

  • Save benabraham/933889b292dc58970a9ea9cbbb3df9bc to your computer and use it in GitHub Desktop.

Select an option

Save benabraham/933889b292dc58970a9ea9cbbb3df9bc to your computer and use it in GitHub Desktop.
npm scripts to convert scss to css and autoprefix and minify using temporary file
"scripts": {
"_css-sass2css": "node-sass --source-map-embed true --precision 6 --source-map-root \"/\" ./scss/style.scss ./css-temp/style.css",
"_css-postcss": "postcss ./css-temp/style.css --use autoprefixer --output ./css-temp/style.css",
"_css-minify": "csso --input ./css-temp/style.css --output ./css-temp/style.css --source-map ./css-temp/style.css.map",
"_css-move": "ncp ./css-temp/ ./css/",
"_css-cleanup": "rimraf ./css-temp",
"css-compile": "npm run _css-sass2css && npm run _css-postcss && npm run _css-minify && npm run _css-move && npm run _css-cleanup",
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment