Skip to content

Instantly share code, notes, and snippets.

Last active October 4, 2018 00:16
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Npm Build Script (will replace Grunt in blog post)
# Browsers that we support
last 2 version
"name": "",
"version": "4.0.0",
"description": "",
"main": "index.php",
"scripts": {
"scss": "node-sass --output-style nested -o dist/css src/scss",
"cssfonts": "postcss -u postcss-fontpath -r dist/css/main.css",
"cssprefix": "postcss -u autoprefixer -r dist/css/main.css",
"cssmin": "postcss dist/css/main.css > dist/css/main.min.css",
"imagemin": "imagemin src/images dist/images -p",
"copy:js": "cp -R src/js/ dist/js/",
"build:css": "npm run scss && npm run cssfonts && npm run cssprefix && npm run cssmin",
"build:tsc": "tsc",
"build:js": "npm run build:tsc && npm run copy:js",
"build": "npm run build:css && npm run build:js",
"watch:css": "onchange 'src/scss/*/*.scss' -- npm run build:css",
"watch:js": "onchange 'src/ts/*.ts' -- npm run build:js",
"watch": "npm-run-all --parallel watch:*",
"start": "npm run build && npm run watch"
"keywords": [],
"author": "Jennifer Tesolin",
"license": "ISC",
"devDependencies": {
"autoprefixer": "^8.6.5",
"cssnano": "^3.10.0",
"imagemin-cli": "^3.0.0",
"node-sass": "^4.9.3",
"npm-run-all": "^4.1.3",
"onchange": "^4.1.0",
"postcss": "^6.0.23",
"postcss-cli": "^5.0.1",
"postcss-fontpath": "^1.0.0",
"typescript": "^3.0.3"
"dependencies": {}
module.exports = {
plugins: [
preset: 'default',
"compilerOptions": {
"target": "es5",
"lib": ["es2017", "dom"],
"module": "commonjs",
"outDir": "src/js/",
"sourceMap": true,
"strict": true
"include": [
"exclude": [
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment