Last active
January 1, 2016 01:39
-
-
Save ezynda3/8074713 to your computer and use it in GitHub Desktop.
Starter Gruntfile
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
//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