Grunt to simplify front-end development workflow for Sitecore projects
Requires Grunt ~0.4.0
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins.
Download and add to your project. Open Gruntfile.js, edit the config, npm install
, and away you go!
{
"scss_folder" : "scss",
"css_folder" : "css",
"img_folder" : "images",
"js_folder" : "js",
"project_path" : "D:/TFS2012/Hello World/Foo.HelloWorld.Website",
"sitecore_path" : "C:/Sitecore/HelloWorld/Website",
"watch_scss" : [
"style.scss",
"normalize.scss",
"print.scss",
"ie-master.scss"
],
"watch_coffee" : [
"project/*.coffee",
"app.coffee",
"lib.coffee"
],
"copy_js" : [
"lib.js",
"app.js",
"custom-net.js"
],
"app_js" : [
"app.coffee"
],
"jsdocs_folder" : "project",
"jsdocs_folder_output" : "docs",
"lib_js" : [
"project/initfoundation.coffee",
"project/general.coffee",
"project/mobile.coffee",
"project/language-toggler.coffee"
]
}
Simply type grunt watch
during production, however there a few tasks you may run directly on adhoc basis for example:
grunt grunticon
: Creates PNG version of SVG imagesgrunt cssmetrics
: See how big your compiled CSS files aregrunt cssmin
: Minify compiled CSS files (files are named to *.min.css)
- load-grunt-tasks
- grunt-contrib-coffee
- grunt-contrib-watch
- grunt-sync
- grunt-docco
- grunt-contrib-sass
- grunt-css-metrics
- grunt-svg2png
- grunt-contrib-cssmin
- grunt-newer
- time-grunt
- 0.2.3: Tweaked SASS task for better performance
- 0.2.2: Replaced grunt-contrib-copy with grunt-sync for better ASPX/ASCX watching & copying
- 0.2.1: Removed config options from Gruntfile.js
- 0.2.0: Initial release
- Add growl support for notification
- SVG optimisation
Feel free to use, modify, etc but this is still under development, so use at your own risk. :)
Unless required by applicable law or agreed to in writing, this work is published on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.