Gruntfile.js.bk 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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: 'node_modules/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. };//end main file