gruntfile.js 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. module.exports = function (grunt) {
  2. grunt.initConfig({
  3. pkg: grunt.file.readJSON('package.json'),
  4. jshint: {
  5. all: ['gruntfile.js', 'gulpfile.js', 'src/**/*.js']
  6. },
  7. bootlint: {
  8. options: {},
  9. files: ['*.html', 'examples/**/*.html']
  10. },
  11. checkPages: {
  12. development: {
  13. options: {
  14. pageUrls: [
  15. 'index.html',
  16. 'examples/basic.html',
  17. 'examples/clear-formatting.html',
  18. 'examples/events.html',
  19. 'examples/form-post.html',
  20. 'examples/formatblock-example.html',
  21. 'examples/html-editor.html',
  22. 'examples/multiple-editors.html',
  23. 'examples/simple-toolbar.html'
  24. ],
  25. checkLinks: true,
  26. summary: true
  27. }
  28. }
  29. },
  30. uglify: {
  31. options: {
  32. banner: '/* @fileoverview \n' +
  33. ' * Provides full Bootstrap based, multi-instance WYSIWYG editor. \n' +
  34. ' * \n' +
  35. ' * Name = ' + '<%= pkg.name %> \n' +
  36. ' * Author = ' + 'Various, see LICENCE \n' +
  37. ' * Version = ' + 'v<%= pkg.version %> \n' +
  38. ' * About = ' + 'A tiny Bootstrap and jQuery based WYSIWYG rich text editor based on the browser function execCommand. \n' +
  39. '*/ \n\n'
  40. },
  41. dist: {
  42. files: {
  43. 'js/bootstrap-wysiwyg.min.js': ['src/**/*.js']
  44. },
  45. }
  46. },
  47. release: {
  48. options: {
  49. additionalFiles: ['bower.json', 'src/bootstrap-wysiwyg.js'],
  50. commit: false,
  51. npm: false,
  52. npmTag: false,
  53. push: false,
  54. pushTags: false,
  55. tag: false
  56. }
  57. },
  58. watch: {
  59. files: ['gruntfile.js', 'gulpfile.js', 'src/**/*.js', '*.html', 'examples/**/*.html'],
  60. tasks: ['jshint', 'bootlint', 'checkPages', 'uglify']
  61. }
  62. });
  63. grunt.loadNpmTasks('grunt-check-pages');
  64. grunt.loadNpmTasks('grunt-bootlint');
  65. grunt.loadNpmTasks('grunt-contrib-jshint');
  66. grunt.loadNpmTasks('grunt-contrib-rename');
  67. grunt.loadNpmTasks('grunt-contrib-uglify');
  68. grunt.loadNpmTasks('grunt-contrib-watch');
  69. grunt.loadNpmTasks('grunt-release');
  70. grunt.registerTask('default', ['jshint', 'bootlint', 'checkPages', 'uglify', 'watch']);
  71. };