Skip to content

Instantly share code, notes, and snippets.

@ezynda3
Last active January 1, 2016 01:39
Show Gist options
  • Save ezynda3/8074713 to your computer and use it in GitHub Desktop.
Save ezynda3/8074713 to your computer and use it in GitHub Desktop.
Starter Gruntfile
//Gruntfile
module.exports = function(grunt) {
//Initializing the configuration object
grunt.initConfig({
concat: {
options: {
separator: ';'
},
javascript: {
src: [
'./app/assets/js/app.js',
'./bower_components/jquery/jquery.js',
'./bower_components/bootstrap/dist/js/bootstrap.js'
],
dest: './public/js/app.js'
}
},
less: {
development: {
options: {
compress: true, //minify
},
files: {
//compile main stylesheet
'./public/css/styles.css' : './app/assets/less/styles.less'
}
}
},
uglify: {
options: {
mangle: false
},
dist: {
files: {
'./public/js/app.js' : './public/js/app.js'
}
}
},
copy: {
bootstrap: {
files: [
{ expand: true, cwd: './bower_components/bootstrap/dist/fonts/', src: ['**'], dest: './public/fonts/' }
]
}
},
phpunit: {
classes: {
dir: './app/tests/'
},
options: {
bin: 'phpunit',
colors: true
}
},
watch: {
js: {
files: ['./app/assets/js/*.*'],
tasks: ['concat:javascript', 'uglify'],
options: {
livereload: true
}
},
less: {
files: ['./app/assets/less/*.*'],
tasks: ['less'],
options: {
livereload: true
}
},
tests: {
files: ['./app/controllers/*.php', './app/models/*.php'],
tasks: ['phpunit']
}
}
});
//Load plugins
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-phpunit');
//Define the deault task
grunt.registerTask('default', ['watch']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment