pipeline.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. /**
  2. * tasks/pipeline.js
  3. *
  4. * The order in which your CSS, JavaScript, and client-side template files
  5. * injected as <script> or <link> tags.
  6. *
  7. * > If you are not relying on automatic asset linking, then you can safely ignore this file.
  8. *
  9. * For more information see:
  10. * https://sailsjs.com/anatomy/tasks/pipeline.js
  11. */
  12. // ██████╗ ██╗ █████╗ ██╗███╗ ██╗ ██████╗███████╗███████╗
  13. // ██╔══██╗██║ ██╔══██╗██║████╗ ██║ ██╔════╝██╔════╝██╔════╝
  14. // ██████╔╝██║ ███████║██║██╔██╗ ██║ ██║ ███████╗███████╗
  15. // ██╔═══╝ ██║ ██╔══██║██║██║╚██╗██║ ██║ ╚════██║╚════██║
  16. // ██║ ███████╗██║ ██║██║██║ ╚████║ ██╗╚██████╗███████║███████║
  17. // ╚═╝ ╚══════╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝ ╚═╝ ╚═════╝╚══════╝╚══════╝
  18. //
  19. // ███████╗██╗██╗ ███████╗███████╗
  20. // ██╔════╝██║██║ ██╔════╝██╔════╝
  21. // █████╗ ██║██║ █████╗ ███████╗
  22. // ██╔══╝ ██║██║ ██╔══╝ ╚════██║
  23. // ██║ ██║███████╗███████╗███████║
  24. // ╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝
  25. //
  26. // CSS files to inject as <link> tags, in order.
  27. //
  28. // > Note: if you're using built-in LESS support with default settings,
  29. // > you'll want to change `assets/styles/importer.less` instead.
  30. //
  31. var cssFilesToInject = [
  32. // Bring in `.css` files for themes and style guides (e.g. Bootstrap, Foundation)
  33. 'dependencies/**/*.css',
  34. // All of the rest of your custom `.css` files will be injected here,
  35. // in no particular order. To customize the ordering, add additional
  36. // items here, _above_ this one.
  37. 'styles/**/*.css'
  38. ];
  39. // ██████╗██╗ ██╗███████╗███╗ ██╗████████╗ ███████╗██╗██████╗ ███████╗
  40. // ██╔════╝██║ ██║██╔════╝████╗ ██║╚══██╔══╝ ██╔════╝██║██╔══██╗██╔════╝
  41. // ██║ ██║ ██║█████╗ ██╔██╗ ██║ ██║█████╗███████╗██║██║ ██║█████╗
  42. // ██║ ██║ ██║██╔══╝ ██║╚██╗██║ ██║╚════╝╚════██║██║██║ ██║██╔══╝
  43. // ╚██████╗███████╗██║███████╗██║ ╚████║ ██║ ███████║██║██████╔╝███████╗
  44. // ╚═════╝╚══════╝╚═╝╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚══════╝╚═╝╚═════╝ ╚══════╝
  45. //
  46. // ██╗███████╗ ███████╗██╗██╗ ███████╗███████╗
  47. // ██║██╔════╝ ██╔════╝██║██║ ██╔════╝██╔════╝
  48. // ██║███████╗ █████╗ ██║██║ █████╗ ███████╗
  49. // ██ ██║╚════██║ ██╔══╝ ██║██║ ██╔══╝ ╚════██║
  50. // ██╗╚█████╔╝███████║ ██║ ██║███████╗███████╗███████║
  51. // ╚═╝ ╚════╝ ╚══════╝ ╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝
  52. //
  53. // Client-side javascript files to inject as <script> tags, in order.
  54. //
  55. var jsFilesToInject = [
  56. // Load `sails.io` before everything else.
  57. 'dependencies/sails.io.js',
  58. // Bring in `.js` files for any other client-side JavaScript dependencies.
  59. // (e.g. Lodash, Vue.js, jQuery, Bootstrap, Ember, Angular, etc.)
  60. // > Be sure to list dependencies that depend on each other in the right order!
  61. 'dependencies/lodash.js',
  62. 'dependencies/jquery.min.js',
  63. 'dependencies/vue.js',
  64. 'dependencies/bootstrap-4/popper.js',
  65. 'dependencies/**/*.js',
  66. // First amongst the app-level files, bring in cloud configuration
  67. 'js/cloud.setup.js',
  68. // Bring in components & utilities before bringing in the rest (i.e. page scripts)
  69. 'js/components/**/*.js',
  70. 'js/utilities/**/*.js',
  71. // All of the rest of your custom client-side js files will be injected here,
  72. // in no particular order. To customize the ordering, add additional items
  73. // here, _above_ this one.
  74. 'js/**/*.js'
  75. ];
  76. // ██████╗██╗ ██╗███████╗███╗ ██╗████████╗ ███████╗██╗██████╗ ███████╗
  77. // ██╔════╝██║ ██║██╔════╝████╗ ██║╚══██╔══╝ ██╔════╝██║██╔══██╗██╔════╝
  78. // ██║ ██║ ██║█████╗ ██╔██╗ ██║ ██║█████╗███████╗██║██║ ██║█████╗
  79. // ██║ ██║ ██║██╔══╝ ██║╚██╗██║ ██║╚════╝╚════██║██║██║ ██║██╔══╝
  80. // ╚██████╗███████╗██║███████╗██║ ╚████║ ██║ ███████║██║██████╔╝███████╗
  81. // ╚═════╝╚══════╝╚═╝╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚══════╝╚═╝╚═════╝ ╚══════╝
  82. //
  83. // ████████╗███████╗███╗ ███╗██████╗ ██╗ █████╗ ████████╗███████╗███████╗
  84. // ╚══██╔══╝██╔════╝████╗ ████║██╔══██╗██║ ██╔══██╗╚══██╔══╝██╔════╝██╔════╝
  85. // ██║ █████╗ ██╔████╔██║██████╔╝██║ ███████║ ██║ █████╗ ███████╗
  86. // ██║ ██╔══╝ ██║╚██╔╝██║██╔═══╝ ██║ ██╔══██║ ██║ ██╔══╝ ╚════██║
  87. // ██║ ███████╗██║ ╚═╝ ██║██║ ███████╗██║ ██║ ██║ ███████╗███████║
  88. // ╚═╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚══════╝╚═╝ ╚═╝ ╚═╝ ╚══════╝╚══════╝
  89. //
  90. // Client-side HTML templates to precompile and inject as a single <script> tag.
  91. // (The ordering of this array shouldn't matter.)
  92. //
  93. // > By default, Sails uses JST (~=lodash/underscore) templates and precompiles
  94. // > them into functions for you. If you want to use handlebars, pug, dust, etc.,
  95. // > with the asset linker, no problem-- you'll just want to make sure the precompiled
  96. // > templates get spit out to the same file. For information on customizing and
  97. // > installing your own Grunt tasks or using a different build pipeline, be sure
  98. // > to check out:
  99. // > https://sailsjs.com/docs/concepts/assets/task-automation
  100. //
  101. var templateFilesToInject = [
  102. 'templates/**/*.html'
  103. ];
  104. // ███╗ ███╗██╗███████╗ ██████╗ ███████╗███████╗████████╗██╗ ██╗██████╗
  105. // ████╗ ████║██║██╔════╝██╔════╝ ██╔════╝██╔════╝╚══██╔══╝██║ ██║██╔══██╗
  106. // ██╔████╔██║██║███████╗██║ ███████╗█████╗ ██║ ██║ ██║██████╔╝
  107. // ██║╚██╔╝██║██║╚════██║██║ ╚════██║██╔══╝ ██║ ██║ ██║██╔═══╝
  108. // ██║ ╚═╝ ██║██║███████║╚██████╗██╗ ███████║███████╗ ██║ ╚██████╔╝██║
  109. // ╚═╝ ╚═╝╚═╝╚══════╝ ╚═════╝╚═╝ ╚══════╝╚══════╝ ╚═╝ ╚═════╝ ╚═╝
  110. //
  111. // The following code exists to parse the arrays of glob expressions above, and
  112. // then expose them via `module.exports`. **You should not need to change any of
  113. // the code below, unless you are modifying the default asset pipeline.**
  114. // Default path for public folder (see documentation on sailsjs.com for more information)
  115. var tmpPath = '.tmp/public/';
  116. // Prefix relative paths to source files so they point to the proper locations
  117. // (i.e. where the other Grunt tasks spit them out, or in some cases, where
  118. // they reside in the first place)
  119. module.exports.cssFilesToInject = cssFilesToInject.map((cssPath)=>{
  120. // If we're ignoring the file, make sure the ! is at the beginning of the path
  121. if (cssPath[0] === '!') {
  122. return require('path').join('!' + tmpPath, cssPath.substr(1));
  123. }
  124. return require('path').join(tmpPath, cssPath);
  125. });
  126. module.exports.jsFilesToInject = jsFilesToInject.map((jsPath)=>{
  127. // If we're ignoring the file, make sure the ! is at the beginning of the path
  128. if (jsPath[0] === '!') {
  129. return require('path').join('!' + tmpPath, jsPath.substr(1));
  130. }
  131. return require('path').join(tmpPath, jsPath);
  132. });
  133. module.exports.templateFilesToInject = templateFilesToInject.map((tplPath)=>{
  134. // If we're ignoring the file, make sure the ! is at the beginning of the path
  135. if (tplPath[0] === '!') {
  136. return require('path').join('!assets/', tplPath.substr(1));
  137. }
  138. return require('path').join('assets/', tplPath);
  139. });