Gruntfile.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. module.exports = function (grunt) {
  2. "use strict";
  3. var livereload = {
  4. host: 'localhost',
  5. port: 35729
  6. };
  7. grunt.initConfig({
  8. pkg: grunt.file.readJSON('package.json'),
  9. build: {
  10. all: {
  11. dest: "dist/emojionearea.js"
  12. }
  13. },
  14. uglify: {
  15. all: {
  16. files: {
  17. "dist/emojionearea.min.js": ["dist/emojionearea.js"]
  18. },
  19. options: {
  20. preserveComments: false,
  21. sourceMap: true,
  22. ASCIIOnly: true,
  23. sourceMapName: "dist/emojionearea.min.map",
  24. report: "min",
  25. beautify: {
  26. "ascii_only": true
  27. },
  28. banner: "/*! EmojioneArea v<%= pkg.version %> | MIT license */",
  29. compress: {
  30. "hoist_funs": false,
  31. loops: false,
  32. unused: false
  33. }
  34. }
  35. }
  36. },
  37. sass: {
  38. all: {
  39. options: {
  40. unixNewlines: true,
  41. compass: true,
  42. lineNumbers: true
  43. },
  44. files: {
  45. 'dist/emojionearea.css': 'scss/emojionearea.scss'
  46. }
  47. },
  48. },
  49. cssmin: {
  50. target: {
  51. files: {
  52. 'dist/emojionearea.min.css': ['dist/emojionearea.css']
  53. },
  54. options: {
  55. sourceMap: false
  56. }
  57. }
  58. },
  59. watch: {
  60. sass: {
  61. files: [
  62. 'scss/**/*.scss'
  63. ],
  64. tasks: ['sass'],
  65. options: {
  66. livereload: livereload
  67. }
  68. },
  69. js: {
  70. files: [
  71. 'src/**/*.js'
  72. ],
  73. tasks: ['build'],
  74. options: {
  75. livereload: livereload
  76. }
  77. }
  78. },
  79. });
  80. grunt.loadNpmTasks('grunt-contrib-uglify');
  81. grunt.loadNpmTasks('grunt-contrib-cssmin');
  82. grunt.loadNpmTasks('grunt-contrib-watch');
  83. grunt.loadNpmTasks('grunt-contrib-sass');
  84. grunt.loadTasks("tasks");
  85. grunt.registerTask("default", ["build", "uglify", "sass", "cssmin"]);
  86. };