(Feature) Build System: Use npm scripts for the build process (#16)

* (Chore) Editorconfig: Add an editorconfig file so those spaces and tabs dont keep mixing

* (Refactor) Build: use npm scripts to build assets

* (Chore) Build: remove dist files from repo / fix ESLint errors

* (Update) Build: Remove unused tasks / add autoprefixer

* (Chore) Gemfile: remove old dependencies

* (Chore) Package.json: Shrinkwrap & postinstalll

* (Doc) Build: Update instructions for new build system

* (Fix) Build: Wach html files in all folders

* (Fix) Build: exclude _site/ from watch

* (Chore) Build/CI: Update buildscript for node/ruby combined

* (Chore) Travis: Add g++ compiler to environment

* (Chore) Build: fix watched directory

* (Fix) travis: set version to 4.5.0 LTS

* (Fix) travis: remove shrinkwrap

* (Fix) Travis: rvm

* (Fix) Travis: before_install

* (Fix) Travis: ignore dist for html proofer
This commit is contained in:
0xfff 2016-09-17 02:14:13 +02:00 committed by GitHub
parent 0cd655f34b
commit 2b0331ad48
145 changed files with 408 additions and 416 deletions

58
package.json Normal file
View file

@ -0,0 +1,58 @@
{
"name": "dash-website",
"version": "1.0.0",
"description": "The new dash.org website",
"main": "index.js",
"scripts": {
"eslint:dist": "eslint src/js/*.js || exit 0",
"eslint": "npm run eslint:dist",
"uglify:dist": "mkdir -p dist/js/ && ./node_modules/uglify-js/bin/uglifyjs src/js/*.js -m -o dist/js/main.min.js",
"uglify:dev": "mkdir -p dist/js/ && ./node_modules/uglify-js/bin/uglifyjs src/js/*.js -c -o dist/js/main.min.js",
"uglify": "npm run uglify:dist",
"test": "npm run build",
"clean:dist": "rm -rf dist && rm -rf _site",
"clean": "npm run clean:dist",
"copy": "npm run copy:all",
"copy:all": "npm run copy:dist",
"copy:dist": "cp -R dist/ _site/dist/",
"copy:js": "mkdir -p _site/dist/js/ && cp -R dist/js/ _site/dist/js/",
"copy:css": "mkdir -p _site/dist/css/ && cp -R dist/css/ _site/dist/css/",
"prefix": "postcss --use autoprefixer -b 'last 3 versions' --output dist/css/main.min.css dist/css/main.min.css",
"sass:dist": "node-sass --output-style compressed src/scss/main.scss dist/css/main.min.css",
"sass": "npm run sass:dist",
"font": "mkdir -p dist/fonts && cp -R src/fonts/ dist/fonts/",
"imagemin": "imagemin src/images/* _site/dist/images/ -p",
"build:jekyll": "jekyll build --config _config.yml",
"build:js": "npm run eslint && npm run uglify",
"build:css": "npm run sass && npm run prefix",
"build:font": "npm run font",
"build:images": "npm run imagemin",
"reload": "browser-sync reload",
"build": "run-s clean build:js build:css build:font build:jekyll copy",
"watch:jekyll": "onchange 'index.html' '*/*.html' '_includes/**/*.html' '_layouts/**/*.html' '_posts/*' -e '_site/*' -d 500 -- run-s build:jekyll copy reload",
"watch:css": "onchange 'src/scss/**/*' -d 500 -- run-s sass prefix copy:css",
"watch:js": "onchange 'src/js/*' -d 500 -- run-s uglify:dev copy:js reload",
"watch": "run-p serve watch:jekyll watch:css watch:js",
"serve": "browser-sync start --server _site -f '_site/dist/css'",
"start": "npm run build -s && npm run watch",
"postinstall": "gem install bundler && bundle install",
"test": "echo \"No Tests.\" && exit 0"
},
"author": "0xfff <0xfff@protonmail.com>",
"license": "MIT",
"devDependencies": {
"autoprefixer": "6.4.1",
"browser-sync": "2.16.0",
"eslint": "3.5.0",
"image-min": "0.3.2",
"node-sass": "3.4.2",
"npm-run-all": "3.1.0",
"onchange": "3.0.2",
"postcss": "5.0.14",
"postcss-cli": "2.5.0",
"watch": "0.19.2",
"uglify-js": "2.7.3"
},
"dependencies": {
}
}