Gruntfile.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. module.exports = function(grunt) {
  2. // load all grunt tasks
  3. require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
  4. // Project configuration.
  5. grunt.initConfig({
  6. nodeunit: {
  7. all: ['test/*_test.js']
  8. },
  9. less: {
  10. build: {
  11. files: {
  12. "build/css/bootstrap2/bootstrap-switch.css": "src/less/bootstrap2/bootstrap-switch.less",
  13. "build/css/bootstrap3/bootstrap-switch.css": "src/less/bootstrap3/bootstrap-switch.less",
  14. }
  15. }
  16. },
  17. coffee: {
  18. build: {
  19. expand: true,
  20. cwd: 'src/coffee',
  21. src: '**/*.coffee',
  22. dest: 'build/js',
  23. ext: '.js'
  24. }
  25. },
  26. cssmin: {
  27. build: {
  28. expand: true,
  29. src: ['build/css/bootstrap2/bootstrap-switch.css', 'build/css/bootstrap3/bootstrap-switch.css'],
  30. ext: '.min.css'
  31. }
  32. },
  33. uglify: {
  34. build: {
  35. preserveComments: 'some',
  36. expand: true,
  37. src: 'build/js/bootstrap-switch.js',
  38. ext: '.min.js'
  39. }
  40. },
  41. jshint: {
  42. all: ['Gruntfile.js', '*.json', 'build/js/*.js', '!**/*.min.js']
  43. },
  44. bump: {
  45. options: {
  46. files: ['package.json', 'bower.json'],
  47. commitFiles: ['-a'],
  48. push: false
  49. }
  50. }
  51. });
  52. grunt.registerTask('build', ['less', 'coffee', 'cssmin', 'uglify']);
  53. };