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.

131 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. "_src/plugins/jquery-blockUI/jquery.blockUI.js",
  42. "_src/plugins/jquery-cookie/jquery.cookie.js",
  43. "_src/plugins/toastr/toastr.js",
  44. "_src/common/js/global.js",
  45. "_src/common/js/member.js",
  46. "_src/common/js/board.js",
  47. ]
  48. };
  49. var gulp = require('gulp'),
  50. concat = require('gulp-concat'),
  51. minify = require('gulp-minify'),
  52. cleanCSS = require('gulp-clean-css'),
  53. size = require('gulp-size'),
  54. sass = require('gulp-sass');
  55. gulp.task('minify-desktop-css', function () {
  56. return gulp.src( theme.desktop.css )
  57. .pipe(sass({outputStyle: 'compact'}))
  58. .pipe(concat( 'desktop.min.css')) //병합하고
  59. .pipe(cleanCSS().on('error', function(e){console.log(e);}))
  60. .pipe(size({ gzip: true, showFiles: true }))
  61. .pipe(gulp.dest('public_html/assets/css'));
  62. });
  63. // Javascript 합치기 실행
  64. gulp.task('minify-desktop-js', [], function(){
  65. return gulp.src( theme.commonJs.concat( theme.desktop.js ) )
  66. .pipe(concat('admin.js'))
  67. .pipe(minify({
  68. ext: {
  69. min : '.min.js'
  70. },
  71. noSource:true
  72. }))
  73. .pipe(size({ gzip: true, showFiles: true }))
  74. .pipe(gulp.dest('public_html/assets/js'));
  75. });
  76. gulp.task('minify-mobile-css', function () {
  77. return gulp.src( theme.mobile.css )
  78. .pipe(sass({outputStyle: 'compact'}))
  79. .pipe(concat( 'mobile.min.css')) //병합하고
  80. .pipe(cleanCSS().on('error', function(e){console.log(e);}))
  81. .pipe(size({ gzip: true, showFiles: true }))
  82. .pipe(gulp.dest('public_html/assets/css'));
  83. });
  84. gulp.task('minify-mobile-js', [], function(){
  85. return gulp.src( theme.commonJs.concat( theme.mobile.js ) )
  86. .pipe(concat( 'mobile.js'))
  87. .pipe(minify({
  88. ext: {
  89. min : '.min.js'
  90. },
  91. noSource:true
  92. }))
  93. .pipe(size({ gzip: true, showFiles: true }))
  94. .pipe(gulp.dest('public_html/assets/js'));
  95. });
  96. gulp.task('minify-admin-css', function () {
  97. return gulp.src( theme.admin.css )
  98. .pipe(sass({outputStyle: 'compact'}))
  99. .pipe(concat('admin.min.css')) //병합하고
  100. .pipe(cleanCSS().on('error', function(e){console.log(e);}))
  101. .pipe(size({ gzip: true, showFiles: true }))
  102. .pipe(gulp.dest('public_html/assets/css'));
  103. });
  104. gulp.task('minify-admin-js', [], function(){
  105. return gulp.src( theme.commonJs.concat( theme.admin.js ) )
  106. .pipe(concat( 'admin.js') )
  107. .pipe(minify({
  108. ext: {
  109. min : '.min.js'
  110. },
  111. noSource:true
  112. }))
  113. .pipe(size({ gzip: true, showFiles: true }))
  114. .pipe(gulp.dest('public_html/assets/js'));
  115. });
  116. gulp.task('mobile-minify', ['minify-mobile-js', 'minify-mobile-css']);
  117. gulp.task('desktop-minify', ['minify-desktop-js', 'minify-desktop-css']);
  118. gulp.task('admin-minify', ['minify-admin-js', 'minify-admin-css']);
  119. gulp.task('default', ['minify-desktop-js', 'minify-desktop-css', 'minify-mobile-js', 'minify-mobile-css','minify-admin-js', 'minify-admin-css']);