1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-19 04:55:30 -04:00

refactor npm build scripts

This commit is contained in:
2019-12-12 08:12:49 -05:00
parent 24f9e4eb16
commit c7807a0ef1
7 changed files with 116 additions and 3522 deletions

View File

@@ -14,28 +14,25 @@
"url": "git+https://github.com/jakejarvis/jarv.is.git"
},
"scripts": {
"build": "yarn clean && yarn hugo:version && yarn hugo:build && yarn optimize",
"build:preview": "yarn clean && yarn hugo:version && yarn hugo:build-dev",
"hugo:build": "hugo --gc --cleanDestinationDir --verbose",
"hugo:build-dev": "cross-env HUGO_ENV=development hugo -e development --buildDrafts --buildFuture --baseURL ${DEPLOY_PRIME_URL:-/} --gc --cleanDestinationDir --verbose",
"hugo:version": "hugo version; hugo env",
"start": "yarn serve:hugo",
"serve:hugo": "hugo server --buildDrafts --buildFuture --port 1313 --bind 0.0.0.0 --verbose",
"serve:docker": "docker build -t jarv.is:develop -f Dockerfile . && docker run -v $(pwd):/src -p 1313:1313 jarv.is:develop",
"serve:netlify": "netlify dev --command 'yarn serve:hugo'",
"optimize": "get-folder-size --folder=public; yarn optimize:html && yarn optimize:css && yarn optimize:img; get-folder-size --folder=public",
"clean": "rimraf public/ resources/",
"build": "run-s clean hugo optimize",
"build:preview": "run-s clean hugo:dev",
"hugo": "hugo --gc --cleanDestinationDir --verbose",
"hugo:dev": "hugo --environment development --baseURL \"${DEPLOY_PRIME_URL:-/}\" --buildDrafts --buildFuture --gc --cleanDestinationDir --verbose",
"start": "hugo server --buildDrafts --buildFuture --port 1313 --bind 0.0.0.0 --verbose",
"optimize": "run-p optimize:**",
"optimize:html": "html-minifier --html5 --collapse-whitespace --preserve-line-breaks --minify-css --file-ext html --input-dir public --output-dir public **/*.html",
"optimize:css": "cleancss -O0 --format 'keep-breaks' -o public/style.css public/style.css",
"optimize:img": "find public -type d | xargs -n1 -P8 -I{} imagemin {}/* --plugin=jpegoptim --plugin=pngquant --plugin=optipng --plugin=svgo --plugin=gifsicle --out-dir={}",
"lint": "yarn lint:markdown; yarn lint:sass",
"lint": "run-p lint:**",
"lint:markdown": "markdownlint content/notes/**/*.md",
"lint:sass": "stylelint assets/sass/**/* --syntax scss",
"clean": "rimraf public/ resources/"
"debug:hugo": "hugo version; hugo env",
"debug:size": "get-folder-size --folder=public"
},
"dependencies": {},
"devDependencies": {
"clean-css-cli": "~4.3.0",
"cross-env": "^6.0.3",
"get-folder-size": "^2.0.1",
"html-minifier": "~4.0.0",
"hugo-bin": "0.48.1",
@@ -46,16 +43,15 @@
"imagemin-pngquant": "^8.0.0",
"imagemin-svgo": "^7.0.0",
"markdownlint-cli": "~0.19.0",
"netlify-cli": "^2.25.0",
"npm-run-all": "^4.1.5",
"rimraf": "^3.0.0",
"shx": "^0.3.2",
"stylelint": "~12.0.0",
"stylelint-config-recommended-scss": "~4.1.0",
"stylelint-scss": "~3.13.0"
},
"engines": {
"node": ">=12.13.0",
"npm": "^6.13.0",
"npm": "*** Use Yarn instead, please! https://yarnpkg.com/en/docs/cli/install ***",
"yarn": "^1.19.2"
},
"hugo-bin": {