Skip to content

Instantly share code, notes, and snippets.

@martinbean
Created August 9, 2015 19:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martinbean/df38320664069d2f4129 to your computer and use it in GitHub Desktop.
Save martinbean/df38320664069d2f4129 to your computer and use it in GitHub Desktop.
Bower/Grunt example
{
"analytics": false,
"directory": "vendor/bower_components",
"interactive": false
}
{
"name": "project-name",
"private": true,
"dependencies": {
"html5shiv": "~3.7.3",
"jquery": "~2.1.4",
"bootstrap": "~3.3.5"
}
}
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
cssmin: {
dist: {
files: {
'public/css/application.min.css': ['public/css/application.css']
},
options: {
keepSpecialComments: false
}
}
},
less: {
dist: {
files: {
'public/css/application.css': 'resources/assets/less/application.less'
},
options: {
cleancss: true,
paths: [
'vendor/bower_components/bootstrap/less/'
]
}
}
},
uglify: {
dist: {
files: {
'public/js/application.min.js': ['public/js/application.js']
}
}
},
watch: {
configFiles: {
files: ['Gruntfile.js'],
options: {
reload: true
}
},
less: {
files: ['resources/assets/less/*.less'],
tasks: ['less', 'cssmin']
}
}
});
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['watch']);
grunt.registerTask('dist', ['less', 'cssmin', 'uglify']);
};
{
"name": "project-name",
"private": true,
"dependencies": {
"bower": "^1.4.1",
"grunt": "^0.4.5",
"grunt-contrib-cssmin": "^0.13.0",
"grunt-contrib-less": "^1.0.1",
"grunt-contrib-uglify": "^0.9.1",
"grunt-contrib-watch": "^0.6.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment