Gruntfile.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. module.exports = function(grunt) {
  2. grunt.initConfig({
  3. pkg: grunt.file.readJSON("package.json"),
  4. browserify: {
  5. dev: {
  6. src: ["dist/exports.js"],
  7. dest: "dist/peer.js"
  8. }
  9. },
  10. uglify: {
  11. prod: {
  12. options: { mangle: true },
  13. src: "dist/peer.js",
  14. dest: "dist/peer.min.js"
  15. }
  16. },
  17. copy: {
  18. dev: {
  19. files: [
  20. {
  21. src: "dist/peer.min.js",
  22. dest: "./test/public/peer.min.js"
  23. }
  24. ]
  25. }
  26. },
  27. concat: {
  28. dev: {
  29. src: "dist/peer.js",
  30. dest: "dist/peer.js"
  31. },
  32. prod: {
  33. src: "dist/peer.min.js",
  34. dest: "dist/peer.min.js"
  35. }
  36. },
  37. ts: {
  38. default: {
  39. src: ["./lib/**/*.ts", "!node_modules/**"],
  40. tsconfig: "./tsconfig.json"
  41. },
  42. options: {
  43. failOnTypeErrors: false
  44. }
  45. }
  46. });
  47. grunt.loadNpmTasks("grunt-browserify");
  48. grunt.loadNpmTasks("grunt-contrib-uglify");
  49. grunt.loadNpmTasks("grunt-contrib-concat");
  50. grunt.loadNpmTasks("grunt-contrib-copy");
  51. grunt.loadNpmTasks("grunt-ts");
  52. grunt.registerTask("default", [
  53. "ts",
  54. "browserify",
  55. "uglify",
  56. "concat",
  57. "copy"
  58. ]);
  59. };