Gruntfile.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. module.exports = function(grunt)
  2. {
  3. grunt.initConfig({
  4. pkg: grunt.file.readJSON('package.json'),
  5. watch: {
  6. myscss: {
  7. files: ['scss/**/*.scss'],
  8. tasks: ['sass:dist'],
  9. options: {
  10. spawn: false,
  11. },
  12. },
  13. },
  14. //end watch -this watches ccustom.scss and evokes sass:dist which puts custome css in public/css
  15. sass: { // Begin Sass Plugin
  16. dist: {
  17. options: {
  18. sourcemap: 'none'
  19. }, //end dist
  20. files: [{ expand: true,cwd: 'scss', src: ['**/*.scss'], dest: 'public/css', ext: '.css' }]
  21. },
  22. // this task sass with this target dist converts scss to css
  23. dist2: {
  24. options: {
  25. sourcemap: 'none'
  26. },
  27. files: [{ expand: true,cwd: 'vendor/twbs/bootstrap/scss', src: ['**/*.scss'], dest: 'bootstrapCss', ext: '.css' }]
  28. }// end dist2
  29. }, //end sass main
  30. concat: {
  31. options: {
  32. separator: '/* */\n',
  33. },
  34. dist: {
  35. src: ['bootstrapCss/bootstrap.css', 'bootstrapCss/bootstrap-grid.css', 'bootstrapCss/bootstrap-reboot.css'],
  36. dest: 'public/css/bootstrap.css',
  37. },
  38. },//end concat -this combines the 3 bootstrap in to one.
  39. });// end config
  40. //load plugins
  41. grunt.loadNpmTasks('grunt-contrib-jshint');
  42. // grunt.loadNpmTasks('grunt-contrib-uglify');
  43. grunt.loadNpmTasks('grunt-contrib-less');
  44. grunt.loadNpmTasks('grunt-contrib-cssmin');
  45. grunt.loadNpmTasks('grunt-contrib-sass');
  46. grunt.loadNpmTasks('grunt-contrib-copy');
  47. grunt.loadNpmTasks('grunt-contrib-watch');
  48. grunt.loadNpmTasks('grunt-browser-sync');
  49. grunt.loadNpmTasks('grunt-contrib-concat');
  50. //source of scss is scss and custom.css is in public css
  51. grunt.registerTask('run', 'Log something', function() {
  52. grunt.log.write('i am running ').ok();
  53. });
  54. grunt.registerTask('do1', ['sass:dist']);
  55. grunt.registerTask('do2', [ 'sass:dist2' ]);
  56. grunt.registerTask('do3', ['concat:dist']);
  57. grunt.registerTask('myscss', ['watch']);
  58. grunt.registerTask('default', function(){
  59. grunt.log.writeln('Hello from Grunt via grunt.');
  60. });
  61. };//end main file