Gruntfile.js 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. module.exports = function(grunt) {
  2. "use strict";
  3. // Project configuration
  4. grunt.initConfig({
  5. // Read package.json Metadata.
  6. pkg: grunt.file.readJSON('package.json'),
  7. banner: '/*******************************************************************************\n' +
  8. ' * <%= pkg.name %> (version <%= pkg.version %>)\n' +
  9. ' * Author: <%= pkg.author %>\n' +
  10. ' * Created on: <%= grunt.template.today("mmmm dd,yyyy") %>\n' +
  11. ' * Project: <%= pkg.name %>\n' +
  12. ' * Copyright: Unlicensed Public Domain\n' +
  13. ' *******************************************************************************/\n',
  14. less: {
  15. rtl: {
  16. options: {
  17. strictMath: true,
  18. cleancss: false,
  19. sourceMap: true,
  20. outputSourceFiles: true,
  21. sourceMapURL: '<%= pkg.name %>.css.map',
  22. sourceMapFilename: 'dist/css/<%= pkg.name %>.css.map'
  23. },
  24. files: {
  25. 'dist/css/<%= pkg.name %>.css': 'less/bootstrap-rtl.less'
  26. }
  27. },
  28. flipped: {
  29. options: {
  30. strictMath: true,
  31. cleancss: false,
  32. sourceMap: true,
  33. outputSourceFiles: true,
  34. sourceMapURL: '<%= pkg.name %>-flipped.css.map',
  35. sourceMapFilename: 'dist/css/bootstrap-flipped.css.map'
  36. },
  37. files: {
  38. 'dist/css/bootstrap-flipped.css': 'less/bootstrap-flipped.less'
  39. }
  40. },
  41. minify: {
  42. options: {
  43. cleancss: true
  44. },
  45. files: {
  46. 'dist/css/<%= pkg.name %>.min.css': 'dist/css/<%= pkg.name %>.css',
  47. 'dist/css/bootstrap-flipped.min.css': 'dist/css/bootstrap-flipped.css',
  48. }
  49. }
  50. },
  51. usebanner: {
  52. options: {
  53. position: 'top',
  54. banner: '<%= banner %>',
  55. linebreak: true
  56. },
  57. files: {
  58. src: ['dist/css/<%= pkg.name %>.css',
  59. 'dist/css/bootstrap-flipped.css',
  60. 'dist/css/<%= pkg.name %>.min.css',
  61. 'dist/css/bootstrap-flipped.min.css']
  62. }
  63. }
  64. });
  65. // Load uglify plugin
  66. grunt.loadNpmTasks('grunt-contrib-less');
  67. grunt.loadNpmTasks('grunt-banner');
  68. // Default Task
  69. grunt.registerTask('default', ['less', 'usebanner']);
  70. };