Skip to content

Instantly share code, notes, and snippets.

@maddesigns
Created March 15, 2017 12:55
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 maddesigns/0e9751c5cf37550d97aaf2eb428711fe to your computer and use it in GitHub Desktop.
Save maddesigns/0e9751c5cf37550d97aaf2eb428711fe to your computer and use it in GitHub Desktop.
NPM Scripts
"autoprefixer": "postcss -u autoprefixer -m --autoprefixer.browsers 'last 10 versions, ie >= 11, Android >= 4.4' -r .tmp/css/*",
"clean:dist": "rm -rf dist/*",
"clean:tmp": "rm -rf tmp",
"clean": "npm run clean:dist && npm run clean:tmp",
"copy:dist": "cp -R src/ dist/",
"copy": "npm run copy:dist",
"sass:dist": "node-sass --output-style expanded src/css/style.scss dist/css/style.css",
"sass:tmp": "node-sass -w -r --output-style expanded src/css/style.scss .tmp/css/style.css",
"sasspref": "node-sass --output-style expanded --include-path src/css < src/css/style.scss | postcss -u autoprefixer --autoprefixer.browsers 'last 2 versions, ie >= 11, Android >= 4.4' > .tmp/css/style.css",
"sass": "npm run sasspref",
"cssmin:dist": "postcss -u autoprefixer --autoprefixer.browsers 'last 2 versions, ie >= 11, Android >= 4.4' -u cssnano -r dist/css/*",
"inlinecss": "inline-css -i dist/index.html -o dist/index.html",
"htmlmin:dist": "htmlmin src/index.html > dist/index.html",
"htmlmin": "npm run htmlmin:dist",
"imagemin:dist": "imagemin --plugin=mozjpeg src/img/ dist/img/ ",
"imagemin:tmp": "imagemin --plugin=mozjpeg src/img/ .tmp/img/ ",
"build:html": "npm run htmlmin",
"build:css": "npm run sass:dist",
"build:cssmin": "npm run cssmin:dist",
"build:images": "npm run imagemin:dist",
"prebuild": "npm run clean && npm run copy",
"postbuild": "npm run build:images && npm run inlinecss",
"build": "npm run build:html && npm run build:css && npm run build:cssmin",
"watch": "parallelshell 'npm run watch:css' 'npm run watch:js' 'npm run watch:html' 'npm run watch:img'",
"server": "browser-sync start --server '.tmp' --files '.tmp/css/*.css','./tmp/js/**/*.js','.tmp/*.html' --directory --reload-delay 500 --reload-debounce 500 --open 'external' --index 'overview.html' --no-ghost-mode",
"start": "npm-run-all -l -n -p server choki",
"watch": "watch 'npm run sasspref' src/css --wait=0--interval=0",
"choki": "chokidar 'src/css' -c 'npm run sasspref' "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment