Skip to content

Instantly share code, notes, and snippets.

@escapedcat
Last active May 16, 2018 09:39
Show Gist options
  • Save escapedcat/5ff41e4b2b88e11d4f95 to your computer and use it in GitHub Desktop.
Save escapedcat/5ff41e4b2b88e11d4f95 to your computer and use it in GitHub Desktop.
npm scripts including node-sass and autoprefixer
{
"name": "foo",
"version": "1.0.0",
"description": "foo project",
"main": "index.js",
"scripts": {
"start": "npm run serve | npm run watch-css",
"serve": "./node_modules/.bin/http-server -p 8080",
"build-css": "./node_modules/node-sass/bin/node-sass app/sass/style.scss -o app/css/ && ./node_modules/postcss-cli/bin/postcss --use autoprefixer app/css/style.css -d app/css/",
"watch-css": "nodemon -e scss -x 'npm run build-css'"
},
"author": "",
"license": "ISC",
"dependencies": {
"autoprefixer": "6.1.2",
"node-sass": "3.4.2",
"postcss-cli": "2.3.2"
},
"devDependencies": {
"http-server": "^0.8.5"
}
}
@simonfranzen
Copy link

simonfranzen commented Mar 20, 2018

@aronhoyer I got working scripts:

"build-css": "./node_modules/node-sass/bin/node-sass public/sass/index.scss -o public/css && npx ./node_modules/postcss-cli/bin/postcss public/css/index.css  --use autoprefixer -d public/css",
"watch-css": "./node_modules/nodemon/bin/nodemon.js -e scss -x 'npm run build-css'"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment