Skip to content

Commit

Permalink
clean up gruntfile
Browse files Browse the repository at this point in the history
* split config using grunt-load-configs
* pretty print .json and .js
* add .jshintrc to keep format clean
* add time-grunt
  • Loading branch information
janraasch committed Feb 13, 2014
1 parent a114569 commit 3a1906e
Show file tree
Hide file tree
Showing 25 changed files with 487 additions and 431 deletions.
16 changes: 16 additions & 0 deletions .jshintrc
@@ -0,0 +1,16 @@
{
"bitwise": true,
"eqeqeq": true,
"forin": true,
"indent": 4,
"quotmark": "double",
"latedef": true,
"noarg": true,
"nonew": true,
"plusplus": true,
"undef": true,
"unused": true,
"strict": true,
"freeze": true,
"node": true
}
20 changes: 20 additions & 0 deletions config/bake.json
@@ -0,0 +1,20 @@
{
"de": {
"options": {
"content": "app/lang/language.json",
"section": "de"
},
"files": {
"dev/index.html": "app/index.html"
}
},
"en": {
"options": {
"content": "app/lang/language.json",
"section": "en"
},
"files": {
"dev/index_en.html": "app/index.html"
}
}
}
6 changes: 6 additions & 0 deletions config/bump.json
@@ -0,0 +1,6 @@
{
"files": [
"package.json",
"bower.json"
]
}
9 changes: 9 additions & 0 deletions config/clean.json
@@ -0,0 +1,9 @@
{
"public": [
"public/css/main.css",
"public/js/main.js"
],
"live": [
"public"
]
}
16 changes: 16 additions & 0 deletions config/compress.json
@@ -0,0 +1,16 @@
{
"svg": {
"options": {
"mode": "gzip"
},
"files": [
{
"expand": true,
"cwd": "app/img/svg/",
"src": "*.svg",
"dest": "dev/img/",
"ext": ".svgz"
}
]
}
}
12 changes: 12 additions & 0 deletions config/concat.json
@@ -0,0 +1,12 @@
{
"js": {
"src": [
"bower_components/jquery/jquery.min.js",
"app/js/bootstrap.js",
"app/js/lazyload.js",
"app/js/collapse.js",
"app/js/script.js"
],
"dest": "dev/js/main.js"
}
}
18 changes: 18 additions & 0 deletions config/connect.json
@@ -0,0 +1,18 @@
{
"dev": {
"options": {
"port": 8089,
"base": "dev"
}
},
"public": {
"options": {
"port": 8090,
"base": "public"
},
"open": {
"target": "http://localhost:8090",
"appName": "open"
}
}
}
65 changes: 65 additions & 0 deletions config/copy.json
@@ -0,0 +1,65 @@
{
"init": {
"files": [
{
"expand": true,
"cwd": "app",
"src": [
"fonts/**"
],
"dest": "dev/css"
},
{
"expand": true,
"cwd": "app",
"src": [
"img/*.*"
],
"dest": "dev",
"filter": "isFile"
},
{
"expand": true,
"cwd": "app",
"src": [
".htaccess",
"robots.txt",
"sitemap.xml"
],
"dest": "dev",
"filter": "isFile"
}
]
},
"public": {
"files": [
{
"expand": true,
"cwd": "dev/css/",
"src": [
"fonts/**"
],
"dest": "public/css/"
},
{
"expand": true,
"cwd": "dev/",
"src": [
"img/**"
],
"dest": "public"
},
{
"expand": true,
"cwd": "dev/",
"src": [
".htaccess",
"robots.txt",
"sitemap.xml"
],
"dest": "public/",
"filter": "isFile"
}
]
}
}
13 changes: 13 additions & 0 deletions config/cssmin.json
@@ -0,0 +1,13 @@
{
"minify": {
"options": {
"noAdvanced": true
},
"expand": true,
"cwd": "public/css/",
"src": [
"main.clean.min.css"
],
"dest": "public/css/"
}
}
11 changes: 11 additions & 0 deletions config/ftp-deploy.json
@@ -0,0 +1,11 @@
{
"live": {
"auth": {
"host": "srv17.domainssaubillig.de",
"port": 21,
"authKey": "key1"
},
"src": "public",
"dest": "htdocs/ckapke"
}
}
19 changes: 19 additions & 0 deletions config/htmlhint.json
@@ -0,0 +1,19 @@
{
"build": {
"options": {
"tag-pair": true,
"tagname-lowercase": true,
"attr-lowercase": true,
"attr-value-double-quotes": true,
"doctype-first": true,
"spec-char-escape": true,
"id-unique": true,
"head-script-disabled": true,
"style-disabled": true
},
"src": [
"public/index.html",
"dev/index.html"
]
}
}
12 changes: 12 additions & 0 deletions config/htmlmin.json
@@ -0,0 +1,12 @@
{
"dist": {
"options": {
"removeComments": true,
"collapseWhitespace": true
},
"files": {
"public/index.html": "public/index.html",
"public/index_en.html": "public/index_en.html"
}
}
}
17 changes: 17 additions & 0 deletions config/imagemin.json
@@ -0,0 +1,17 @@
{
"dynamic": {
"options": {
"optimizationLevel": 3
},
"files": [
{
"expand": true,
"cwd": "public/img",
"src": [
"**/*.{png,jpg,gif}"
],
"dest": "public/img"
}
]
}
}
10 changes: 10 additions & 0 deletions config/jshint.json
@@ -0,0 +1,10 @@
{
"options": {
"jshintrc": true
},
"all": [
"*{.js,.json}",
"config/*{.js,.json}",
"app/lang/**/*.json"
]
}
7 changes: 7 additions & 0 deletions config/less.json
@@ -0,0 +1,7 @@
{
"css": {
"files": {
"dev/css/main.css": "app/less/main.less"
}
}
}
8 changes: 8 additions & 0 deletions config/open.json
@@ -0,0 +1,8 @@
{
"public": {
"path ": "http://localhost:8090"
},
"live": {
"path ": "http://ckapke.de/"
}
}
4 changes: 4 additions & 0 deletions config/pkg.js
@@ -0,0 +1,4 @@
"use strict";
module.exports = function (grunt) {
return grunt.file.readJSON("package.json");
};
28 changes: 28 additions & 0 deletions config/processhtml.json
@@ -0,0 +1,28 @@
{
"dev": {
"options": {
"process": true
},
"files": {
"dev/index.html": [
"dev/index.html"
],
"dev/index_en.html": [
"dev/index_en.html"
]
}
},
"public": {
"options": {
"process": true
},
"files": {
"public/index.html": [
"dev/index.html"
],
"public/index_en.html": [
"dev/index_en.html"
]
}
}
}
14 changes: 14 additions & 0 deletions config/replace.json
@@ -0,0 +1,14 @@
{
"dev": {
"src": [
"dev/*.html"
],
"dest": "dev/",
"replacements": [
{
"from": "{{%release.version%}}",
"to": "<%= pkg.version %>"
}
]
}
}
12 changes: 12 additions & 0 deletions config/svg2png.json
@@ -0,0 +1,12 @@
{
"all": {
"files": [
{
"src": [
"app/img/svg/*.svg"
],
"dest": "public/img/png/"
}
]
}
}
7 changes: 7 additions & 0 deletions config/uglify.json
@@ -0,0 +1,7 @@
{
"all": {
"files": {
"public/js/main.min.js": "dev/js/main.js"
}
}
}
28 changes: 28 additions & 0 deletions config/uncss.json
@@ -0,0 +1,28 @@
{
"dist": {
"files": {
"public/css/main.clean.min.css": [
"dev/index.html"
]
}
},
"options": {
"ignore": [
".carousel-inner > .item",
".carousel-inner .active",
".info-txt a",
".carousel-inner > .active.left",
".carousel-inner > .active.right",
".carousel-inner > .item > img",
".carousel-inner > .active",
".carousel-inner > .next",
".carousel-inner > .prev",
".carousel-inner > .next.left",
".carousel-inner > .prev.right",
".carousel-inner > .item > a > img",
".site-header .link.enabled",
".lang-en .active-en",
".show"
]
}
}

0 comments on commit 3a1906e

Please sign in to comment.