Skip to content

Instantly share code, notes, and snippets.

@monkeycycle
Created January 28, 2018 20:50
Show Gist options
  • Save monkeycycle/3cbdafebcde3354af6bec48770a643ff to your computer and use it in GitHub Desktop.
Save monkeycycle/3cbdafebcde3354af6bec48770a643ff to your computer and use it in GitHub Desktop.
NPM build pipeline
{
"name": "npm builder",
"version": "1.0.0",
"description": "A basic npm build pipeline.",
"main": "index.html",
"author": "",
"license": "ISC",
"dependencies": {
"bourbon": "4.3.4",
"bourbon-neat": "2.0.0",
"node-refills": "1.0.1",
"normalize.css": "7.0.0"
},
"devDependencies": {
"autoprefixer": "7.2.5",
"browserify": "15.2.0",
"copy": "0.3.0",
"eslint": "4.0.0",
"gm": "1.23.0",
"image-batch-resizer": "0.8.1",
"imagemin": "5.3.1",
"livereload": "0.6.3",
"node-sass": "4.5.3",
"node-sass-magic-importer": "4.1.5",
"nodemon": "1.11.0",
"onchange": "3.2.1",
"postcss": "6.0.16",
"postcss-cli": "4.1.1",
"uglify-js": "3.3.9"
},
"scripts": {
"clean:dist": "rm -rf dist",
"clean:tmp": "rm -rf tmp",
"clean": "npm run clean:dist && npm run clean:tmp",
"image_300": "image-batch-resizer -d ./app/media -s 300 --prefix '300_'",
"image_460": "image-batch-resizer -d ./app/media -s 300 --prefix '460_'",
"image_640": "image-batch-resizer -d ./app/media -s 300 --prefix '640_'",
"image_1024": "image-batch-resizer -d ./app/media -s 300 --prefix '1024_'",
"image_resizing": "npm run image_300 && npm run image_460 && npm run image_640 && npm run image_1024",
"imagemin": "imagemin app/gfx dist/gfx -p && imagemin app/media dist/media -p",
"build:images": "npm run imagemin",
"build-task:compile-scss": "node-sass --include-path node_modules/normalize.css --include-path node_modules/bourbon/app/assets/stylesheets/ --include-path node_modules/bourbon-neat/core/ app/scss/ -o dist/css/",
"build-task:autoprefixer": "postcss -u autoprefixer -r dist/css/*",
"build:css": "npm run build-task:compile-scss && npm run build-task:autoprefixer",
"build-task:lint": "eslint --no-eslintrc app/scripts/*.js",
"build-task:browserify": "mkdir -p dist/js && browserify app/scripts/app.js > dist/js/app.browserify.js",
"build-task:uglify": "uglifyjs dist/js/*.js -m -o dist/js/app.js && uglifyjs dist/js/*.js -m -c -o dist/js/app.min.js",
"build:js": "npm run build-task:browserify && npm run build-task:uglify",
"build:html": "copy 'app/**/*.html' 'dist'",
"build:all": "npm run build:html && npm run build:css && npm run build:js",
"watch:css": "onchange 'app/scss/*.scss' -- npm run build:css",
"watch:js": "onchange 'app/scripts/*.js' -- npm run build:js",
"watch:html": "onchange 'app/**/*.html' -- npm run build:html",
"watch:images": "onchange \"src/images\" -- run-s build:images",
"watch:all": "npm run browser-sync:serve && npm run watch:css && npm run watch:js && npm run watch:html",
"browser-sync:serve": "browser-sync start --server 'dist' --files '*.css, *.js, *.html'",
"build": "npm run clean && npm run build:all",
"start": "npm run clean && npm run build:all && npm run watch:all"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment