Skip to content

Instantly share code, notes, and snippets.

@lmartins
Created April 9, 2013 17:31
Show Gist options
  • Save lmartins/5347664 to your computer and use it in GitHub Desktop.
Save lmartins/5347664 to your computer and use it in GitHub Desktop.
Grunt config to install grunt-concurrent
'use strict';
var path = require('path');
var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet;
var folderMount = function folderMount(connect, point) {
return connect.static(path.resolve(point));
};
module.exports = function(grunt) {
// set up grunt
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
connect: {
livereload: {
options: {
port: 9001,
middleware: function(connect, options) {
return [lrSnippet, folderMount(connect, './')]
}
}
}
},
compass: { // Task
dist: { // Target
options: { // Target options
sassDir: 'css-src',
cssDir: 'css',
environment: 'production',
outputStyle: 'expanded',
debugInfo: true
}
}
},
concat: {
options: {
separator: ';'
},
dist: {
src: [
'js/src/libs/mdf.js',
'js/src/libs/bootstrap/bootstrap-dropdown.js',
'js/src/libs/bootstrap/bootstrap-tab.js',
'js/src/libs/flexslider.min.js',
'js/src/libs/mGallery.js',
'js/src/libs/superfish.min.js',
'js/src/libs/jquery.actual.min.js',
'js/src/appController.js'
],
dest: 'js/dist/app.js'
},
article: {
src: [
'js/src/libs/popeye/jquery.popeye-2.1.js',
'js/src/libs/galleria/galleria.js',
'js/src/articleController.js'
],
dest: 'js/dist/article.js'
}
},
uglify: {
my_target: {
files: {
'js/dist/app.min.js': ['js/dist/app.js'],
'js/dist/article.min.js': ['js/dist/article.js']
}
}
},
regarde: {
txt: {
files: ['css-src/**/*.scss'],
tasks: ['compass']
},
js: {
files: ['js/src/**/*.js'],
tasks: ['concat','uglify']
},
compiled: {
files: ['css/*.css','js/dist/*.js'],
tasks: ['livereload']
},
tpl: {
files: ['views/**/*.tpl'],
tasks: ['livereload']
}
}
});
grunt.loadNpmTasks('grunt-regarde');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-livereload');
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-notify');
// grunt.loadNpmTasks('grunt-devtools');
// the default task can be run just by typing "grunt" on the command line
// grunt.registerTask('default', ['coffee']);
grunt.registerTask('default', [
'livereload-start',
'connect',
'regarde'
]);
// grunt.registerTask('js', ['concat', 'uglify']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment