Skip to content

Instantly share code, notes, and snippets.

@jennifert
Last active October 4, 2018 00:16
Show Gist options
  • Save jennifert/3ca4225cf7876e560eb1cd9e91994b97 to your computer and use it in GitHub Desktop.
Save jennifert/3ca4225cf7876e560eb1cd9e91994b97 to your computer and use it in GitHub Desktop.
Npm Build Script (will replace Grunt in blog post)
# Browsers that we support
last 2 version
{
"name": "jenntesolin.com",
"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: [
require('cssnano')({
preset: 'default',
}),
],
};
{
"compilerOptions": {
"target": "es5",
"lib": ["es2017", "dom"],
"module": "commonjs",
"outDir": "src/js/",
"sourceMap": true,
"strict": true
},
"include": [
"src/ts/*"
],
"exclude": [
"node_modules",
"tsc*"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment