usebanner.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /**
  2. * Copyright © Magento, Inc. All rights reserved.
  3. * See COPYING.txt for license details.
  4. */
  5. 'use strict';
  6. function printCopyright(lang) {
  7. var copyrightText = {
  8. firstLine: 'Copyright © Magento, Inc. All rights reserved.',
  9. secondLine: 'See COPYING.txt for license details.'
  10. },
  11. nlWin = '\r\n';
  12. switch (lang) {
  13. case 'css':
  14. return '/**' + nlWin + ' * ' + copyrightText.firstLine + nlWin + ' * ' + copyrightText.secondLine + nlWin + ' */' + nlWin;
  15. break;
  16. case 'less':
  17. return '// /**' + nlWin + '// * ' + copyrightText.firstLine + nlWin + '// * ' + copyrightText.secondLine + nlWin + '// */' + nlWin;
  18. break;
  19. case 'html':
  20. return '<!--' + nlWin + '/**' + nlWin + ' * ' + copyrightText.firstLine + nlWin + ' * ' + copyrightText.secondLine + nlWin + ' */' + nlWin + '-->' + nlWin;
  21. break;
  22. default:
  23. return;
  24. }
  25. }
  26. module.exports = {
  27. options: {
  28. position: 'top',
  29. linebreak: true
  30. },
  31. setup: {
  32. options: {
  33. banner: printCopyright('css')
  34. },
  35. files: {
  36. src: '<%= path.css.setup %>/*.css'
  37. }
  38. },
  39. updater: {
  40. options: {
  41. banner: printCopyright('css')
  42. },
  43. files: {
  44. src: '<%= path.css.updater %>/updater.css'
  45. }
  46. },
  47. documentationCss: {
  48. options: {
  49. banner: printCopyright('css')
  50. },
  51. files: {
  52. src: '<%= path.doc %>/**/*.css'
  53. }
  54. },
  55. documentationLess: {
  56. options: {
  57. banner: printCopyright('less')
  58. },
  59. files: {
  60. src: '<%= path.doc %>/**/*.less'
  61. }
  62. },
  63. documentationHtml: {
  64. options: {
  65. banner: printCopyright('html')
  66. },
  67. files: {
  68. src: '<%= path.doc %>/**/*.html'
  69. }
  70. }
  71. };