Gruntfile.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. expand: true,
  36. src: 'build/js/bootstrap-switch.js',
  37. ext: '.min.js'
  38. }
  39. },
  40. jshint: {
  41. all: ['Gruntfile.js', '*.json', 'build/js/*.js', '!**/*.min.js']
  42. },
  43. bump: {
  44. options: {
  45. files: ['package.json', 'bower.json'],
  46. commitFiles: ['-a'],
  47. push: false
  48. }
  49. }
  50. });
  51. grunt.registerTask('build', ['less', 'coffee', 'cssmin', 'uglify']);
  52. };