/Gruntfile.js Secret
Last active
August 29, 2015 14:15
Myproj: config debug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CONFIG: | |
============================== | |
{ | |
"aliases": { | |
"default": { | |
"description": "Default (production) build", | |
"tasks": [ | |
"prod" | |
] | |
}, | |
"dev": { | |
"description": "Development build", | |
"tasks": [ | |
"concurrent:first", | |
"concurrent:second" | |
] | |
}, | |
"prod": { | |
"description": "Production build", | |
"tasks": [ | |
"concurrent:prodFirst", | |
"concurrent:prodSecond" | |
] | |
} | |
}, | |
"autoprefixer": { | |
"dev": { | |
"options": { | |
"browsers": [ | |
"> 1%", | |
"last 2 versions", | |
"Android 2.3", | |
"Android >= 4", | |
"Chrome >= 20", | |
"Firefox >= 3.6", | |
"Firefox ESR", | |
"Explorer >= 7", | |
"iOS >= 6", | |
"Opera >= 12", | |
"Safari >= 6" | |
], | |
"remove": false, | |
"cascade": false, | |
"map": true | |
}, | |
"src": "<%=projectAssets%><%=mainLessOuput%>", | |
"dest": "<%=projectAssets%><%=mainLessOuput%>" | |
}, | |
"prod": { | |
"single_file": { | |
"options": { | |
"browsers": [ | |
"> 1%", | |
"last 2 versions", | |
"Android 2.3", | |
"Android >= 4", | |
"Chrome >= 20", | |
"Firefox >= 3.6", | |
"Firefox ESR", | |
"Explorer >= 7", | |
"iOS >= 6", | |
"Opera >= 12", | |
"Safari >= 6" | |
], | |
"remove": false, | |
"cascade": false, | |
"map": false | |
}, | |
"src": "<%=projectAssets%><%=mainLessOuput%>", | |
"dest": "<%=projectAssets%><%=mainLessOuput%>" | |
} | |
} | |
}, | |
"clean": { | |
"options": { | |
"force": true | |
}, | |
"all": { | |
"src": [ | |
"<%=projectAssets%>**/*.map" | |
], | |
"filter": "isFile" | |
} | |
}, | |
"concat": { | |
"options": { | |
"separator": ";", | |
"sourceMap": true | |
}, | |
"dist": { | |
"src": [ | |
"<%=projectSource%>js/plugins/*.js", | |
"<%=projectSource%>js/plugins/jquery/*.js", | |
"<%=projectSource%>js/bootstrap/transition.js", | |
"<%=projectSource%>js/bootstrap/modal.js", | |
"<%=projectSource%>js/bootstrap/dropdown.js", | |
"<%=projectSource%>js/bootstrap/tab.js", | |
"<%=projectSource%>js/bootstrap/tooltip.js", | |
"<%=projectSource%>js/bootstrap/alert.js", | |
"<%=projectSource%>js/bootstrap/button.js", | |
"<%=projectSource%>js/bootstrap/collapse.js", | |
"<%=projectSource%>js/bootstrap-ext/offcanvas.js", | |
"<%=projectSource%>js/bootstrap-ext/inputmask.js", | |
"<%=projectSource%>js/main.js" | |
], | |
"dest": "<%=projectAssets%><%=mainJSOutput%>" | |
} | |
}, | |
"concurrent": { | |
"options": { | |
"limit": 3 | |
}, | |
"first": [ | |
"concat", | |
"less:dev" | |
], | |
"second": [ | |
"uglify:dev", | |
"autoprefixer:dev" | |
], | |
"prodFirst": [ | |
"concat", | |
"less:prod" | |
], | |
"prodSecond": [ | |
"uglify:prod", | |
"autoprefixer:prod", | |
"clean" | |
] | |
}, | |
"grunt-spritesmith": { | |
"sprite": { | |
"all": { | |
"src": "path/to/your/sprites/*.png", | |
"dest": "destination/of/spritesheet.png", | |
"destCss": "destination/of/sprites.css" | |
} | |
} | |
}, | |
"less": { | |
"dev": { | |
"options": { | |
"compress": true, | |
"cleancss": false, | |
"cleancssOptions": {}, | |
"sourceMap": true, | |
"sourceMapFilename": "<%=projectAssets%><%=mainLessOuput%>.map", | |
"sourceMapBasepath": "../<%=projectSource%>", | |
"sourceMapRootpath": "../<%=projectSource%>" | |
}, | |
"files": { | |
"<%=projectAssets%><%=mainLessOuput%>": "<%=projectSource%><%=mainLessSo | |
urce%>" | |
} | |
}, | |
"prod": { | |
"options": { | |
"compress": true, | |
"cleancss": true, | |
"cleancssOptions": {}, | |
"sourceMap": false | |
}, | |
"files": { | |
"<%=projectAssets%><%=mainLessOuput%>": "<%=projectSource%><%=mainLessSo | |
urce%>" | |
} | |
} | |
}, | |
"uglify": { | |
"dev": { | |
"options": { | |
"sourceMap": true, | |
"sourceMapIncludeSources": true | |
}, | |
"files": [ | |
{ | |
"<%=projectAssets%><%=mainJSOutput%>": "<%=projectAssets%><%=mainJSOut | |
put%>" | |
} | |
] | |
}, | |
"prod": { | |
"options": { | |
"beautify": false, | |
"sourceMap": false, | |
"compress": { | |
"drop_console": true | |
}, | |
"preserveComments": false | |
}, | |
"files": [ | |
{ | |
"<%=projectAssets%><%=mainJSOutput%>": "<%=projectAssets%><%=mainJSOut | |
put%>" | |
} | |
] | |
} | |
}, | |
"watch": { | |
"options": { | |
"spawn": false, | |
"livereload": true | |
}, | |
"scripts": { | |
"files": [ | |
"<%=projectSource%>/js/**/*.js" | |
], | |
"tasks": [ | |
"concat", | |
"uglify:dev" | |
] | |
}, | |
"styles": { | |
"files": [ | |
"<%=projectSource%>/css/**/*.less" | |
], | |
"tasks": [ | |
"less:dev", | |
"autoprefixer:dev" | |
] | |
} | |
}, | |
"projectSource": "../src/", | |
"projectAssets": "../assets/", | |
"mainLessSource": "css/all.less", | |
"mainLessOuput": "css/style.css", | |
"mainJSOutput": "js/main.min.js", | |
"package": { | |
"name": "myproj1", | |
"version": "0.0.1", | |
"devDependencies": { | |
"grunt": "^0.4.5", | |
"grunt-autoprefixer": "^2.0.0", | |
"grunt-combine-media-queries": "^1.0.19", | |
"grunt-concurrent": "^1.0.0", | |
"grunt-contrib-clean": "^0.6.0", | |
"grunt-contrib-concat": "^0.5.0", | |
"grunt-contrib-less": "^0.12.0", | |
"grunt-contrib-uglify": "^0.6.0", | |
"grunt-contrib-watch": "^0.6.1", | |
"grunt-grunticon": "^2.1.2", | |
"grunt-spritesmith": "^3.6.1", | |
"load-grunt-config": "^0.16.0", | |
"time-grunt": "^1.0.0" | |
} | |
} | |
} | |
ALIASES: | |
============================== | |
default {"description":"Default (production) build","tasks":["prod"]} | |
dev {"description":"Development build","tasks":["concurrent:first","concurrent:s | |
econd"]} | |
prod {"description":"Production build","tasks":["concurrent:prodFirst","concurre | |
nt:prodSecond"]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function (grunt) { | |
require('time-grunt')(grunt); | |
require('load-grunt-config')(grunt, { | |
jitGrunt: true, | |
loadGruntTasks: { | |
pattern: '*', | |
scope: 'devDependencies' | |
}, | |
data: { | |
/** Основные пути **/ | |
// Задаются относительно Gruntfile.js | |
projectSource: "../src/", | |
projectAssets: "../assets/", | |
/** Less **/ | |
// Основной Less файл | |
mainLessSource: "css/all.less", // Относительно projectSource | |
mainLessOuput: "css/style.css", // Оносительно projectAssets | |
/** JS **/ | |
// Название и путь объединенного и минифицированного JS файла | |
mainJSOutput: "js/main.min.js" // Оносительно projectAssets | |
} | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment