Created
August 9, 2015 19:55
-
-
Save martinbean/df38320664069d2f4129 to your computer and use it in GitHub Desktop.
Bower/Grunt example
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
{ | |
"analytics": false, | |
"directory": "vendor/bower_components", | |
"interactive": false | |
} |
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
{ | |
"name": "project-name", | |
"private": true, | |
"dependencies": { | |
"html5shiv": "~3.7.3", | |
"jquery": "~2.1.4", | |
"bootstrap": "~3.3.5" | |
} | |
} |
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
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']); | |
}; |
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
{ | |
"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