You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

132 lines
4.2 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. var theme = {
  2. // 데스크탑 테마용
  3. desktop : {
  4. css : [
  5. "_src/desktop/scss/desktop.scss"
  6. ],
  7. js : [
  8. "_src/desktop/js/common.js"
  9. ]
  10. },
  11. // 모바일 테마용
  12. mobile : {
  13. css : [
  14. "_src/mobile/scss/mobile.scss"
  15. ],
  16. js : [
  17. "_src/mobile/js/mobile.js"
  18. ]
  19. },
  20. // ADMIN 테마용
  21. admin : {
  22. css: [
  23. "_src/admin/scss/admin.scss"
  24. ],
  25. js: [
  26. "_src/plugins/ax5core/ax5core.js",
  27. "_src/plugins/ax5ui-mask/ax5mask.js",
  28. "_src/plugins/ax5ui-modal/ax5modal.js",
  29. "_src/plugins/nicescroll/jquery.nicescroll.js",
  30. "_src/plugins/jquery-datetimepicker/jquery.datetimepicker.full.js",
  31. "_src/plugins/jquery-ui-1.12.1.custom/jquery-ui.js",
  32. "_src/admin/js/jquery.formatter.js",
  33. "_src/admin/js/jquery.tmpl.js",
  34. "_src/admin/js/admin.js",
  35. "_src/admin/js/modules/board.js",
  36. "_src/admin/js/modules/faq.js",
  37. "_src/admin/js/modules/member.js",
  38. ]
  39. },
  40. commonJs : [
  41. "node_modules/clipboard/dist/clipboard.js",
  42. "_src/plugins/jquery-blockUI/jquery.blockUI.js",
  43. "_src/plugins/jquery-cookie/jquery.cookie.js",
  44. "_src/plugins/toastr/toastr.js",
  45. "_src/common/js/global.js",
  46. "_src/common/js/member.js",
  47. "_src/common/js/board.js",
  48. ]
  49. };
  50. var gulp = require('gulp'),
  51. concat = require('gulp-concat'),
  52. minify = require('gulp-minify'),
  53. cleanCSS = require('gulp-clean-css'),
  54. size = require('gulp-size'),
  55. sass = require('gulp-sass');
  56. gulp.task('minify-desktop-css', function () {
  57. return gulp.src( theme.desktop.css )
  58. .pipe(sass({outputStyle: 'compact'}))
  59. .pipe(concat( 'desktop.min.css')) //병합하고
  60. .pipe(cleanCSS().on('error', function(e){console.log(e);}))
  61. .pipe(size({ gzip: true, showFiles: true }))
  62. .pipe(gulp.dest('public_html/assets/css'));
  63. });
  64. // Javascript 합치기 실행
  65. gulp.task('minify-desktop-js', [], function(){
  66. return gulp.src( theme.commonJs.concat( theme.desktop.js ) )
  67. .pipe(concat('desktop.js'))
  68. .pipe(minify({
  69. ext: {
  70. min : '.min.js'
  71. },
  72. noSource:true
  73. }))
  74. .pipe(size({ gzip: true, showFiles: true }))
  75. .pipe(gulp.dest('public_html/assets/js'));
  76. });
  77. gulp.task('minify-mobile-css', function () {
  78. return gulp.src( theme.mobile.css )
  79. .pipe(sass({outputStyle: 'compact'}))
  80. .pipe(concat( 'mobile.min.css')) //병합하고
  81. .pipe(cleanCSS().on('error', function(e){console.log(e);}))
  82. .pipe(size({ gzip: true, showFiles: true }))
  83. .pipe(gulp.dest('public_html/assets/css'));
  84. });
  85. gulp.task('minify-mobile-js', [], function(){
  86. return gulp.src( theme.commonJs.concat( theme.mobile.js ) )
  87. .pipe(concat( 'mobile.js'))
  88. .pipe(minify({
  89. ext: {
  90. min : '.min.js'
  91. },
  92. noSource:true
  93. }))
  94. .pipe(size({ gzip: true, showFiles: true }))
  95. .pipe(gulp.dest('public_html/assets/js'));
  96. });
  97. gulp.task('minify-admin-css', function () {
  98. return gulp.src( theme.admin.css )
  99. .pipe(sass({outputStyle: 'compact'}))
  100. .pipe(concat('admin.min.css')) //병합하고
  101. .pipe(cleanCSS().on('error', function(e){console.log(e);}))
  102. .pipe(size({ gzip: true, showFiles: true }))
  103. .pipe(gulp.dest('public_html/assets/css'));
  104. });
  105. gulp.task('minify-admin-js', [], function(){
  106. return gulp.src( theme.commonJs.concat( theme.admin.js ) )
  107. .pipe(concat( 'admin.js') )
  108. .pipe(minify({
  109. ext: {
  110. min : '.min.js'
  111. },
  112. noSource:true
  113. }))
  114. .pipe(size({ gzip: true, showFiles: true }))
  115. .pipe(gulp.dest('public_html/assets/js'));
  116. });
  117. gulp.task('mobile-minify', ['minify-mobile-js', 'minify-mobile-css']);
  118. gulp.task('desktop-minify', ['minify-desktop-js', 'minify-desktop-css']);
  119. gulp.task('admin-minify', ['minify-admin-js', 'minify-admin-css']);
  120. gulp.task('default', ['minify-desktop-js', 'minify-desktop-css', 'minify-mobile-js', 'minify-mobile-css','minify-admin-js', 'minify-admin-css']);