Skip to content

Instantly share code, notes, and snippets.

@anupjon
Last active November 14, 2018 05:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anupjon/1f09fef296d6294dbc14094837bcfc12 to your computer and use it in GitHub Desktop.
Save anupjon/1f09fef296d6294dbc14094837bcfc12 to your computer and use it in GitHub Desktop.
Node script sass compiler
npm install -g node-sass-chokidar autoprefixer chokidar-cli postcss-cli
{
"name": "sass-compiler",
"version": "1.0.0",
"description": "Compile sass, scss files",
"themepath":"wp-config/themes/themename",
"scripts": {
"build-task:scss-compile": "node-sass-chokidar -r --source-map true --output-style compressed $npm_package_themepath/scss/style.scss -o $npm_package_themepath/css",
"build-task:autoprefixer": "postcss $npm_package_themepath/css/*.css --use autoprefixer -d $npm_package_themepath/css",
"scss:build": "npm run build-task:scss-compile && npm run build-task:autoprefixer",
"scss:watch": "chokidar $npm_package_themepath'/scss/**/*.scss' -c 'npm run scss:build'"
},
"author": "Anoop John",
"license": "ISC"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment