vue.config.pages.js 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. const ENABLE_THIRDPARTY_APPS = process.env.VUE_APP_ENABLE_THIRDPARTY_APPS || 'false'
  2. const ENABLE_THIRDPARTY_APPS_BY_DZYNE = process.env.VUE_APP_ENABLE_THIRDPARTY_APPS_BY_DZYNE || 'false'
  3. const ENABLE_THIRDPARTY_APPS_ONLY = process.env.VUE_APP_ENABLE_THIRDPARTY_APPS_ONLY || 'false'
  4. const ENABLE_EXTERNAL_TREE_VIEWER = process.env.VUE_APP_ENABLE_EXTERNAL_PLACEMENT_TREE_VIEWER || 'false'
  5. const ENABLE_PAYMENT_APP = process.env.VUE_APP_ENABLE_PAYMENT_APP || 'false'
  6. const ENABLE_ELKEN_APP_CENTER = process.env.VUE_APP_ENABLE_ELKEN_APP_CENTER || 'false'
  7. const IS_EVO = process.env.VUE_APP_APPLICATION_NAME === 'EVO'
  8. module.exports = {
  9. getPages: function() {
  10. let pages = {}
  11. if (ENABLE_THIRDPARTY_APPS_ONLY !== 'true') {
  12. pages.app = {
  13. entry: 'src/main.js',
  14. template: 'public/index.html',
  15. filename: 'index.html',
  16. title: `Elken ${(IS_EVO && 'EVO') || 'IBS'} Member Portal`,
  17. chunks: ['chunk-app-vendors', 'app'],
  18. }
  19. }
  20. if (ENABLE_THIRDPARTY_APPS === 'true') {
  21. if (ENABLE_THIRDPARTY_APPS_BY_DZYNE === 'true') {
  22. pages['checkout'] = {
  23. entry: 'src/thirdparty/eshop/checkout.js',
  24. template: 'public/checkout.html',
  25. filename: 'app1/index.html',
  26. title: 'Elken Checkout Page',
  27. chunks: ['chunk-checkout-vendors', 'checkout'],
  28. }
  29. pages['product-list'] = {
  30. entry: 'src/thirdparty/eshop/product-list.js',
  31. template: 'public/product-list.html',
  32. filename: 'app2/index.html',
  33. title: 'Elken Product List',
  34. chunks: ['chunk-product-list-vendors', 'product-list'],
  35. }
  36. pages['login'] = {
  37. entry: 'src/thirdparty/eshop/login.js',
  38. template: 'public/login.html',
  39. filename: 'app3/index.html',
  40. title: 'Elken Login Page',
  41. chunks: ['chunk-login-vendors', 'login'],
  42. }
  43. pages['product-viewer'] = {
  44. entry: 'src/thirdparty/eshop/product-viewer.js',
  45. template: 'public/product-viewer.html',
  46. filename: 'app5/index.html',
  47. title: 'Elken Product Previewer',
  48. chunks: ['chunk-product-viewer-vendors', 'product-viewer'],
  49. }
  50. }
  51. if (ENABLE_EXTERNAL_TREE_VIEWER === 'true') {
  52. pages['placement-tree'] = {
  53. entry: 'src/thirdparty/placement-tree-viewer/main.js',
  54. template: 'public/placement-tree-viewer.html',
  55. filename: 'treeapp/index.html',
  56. title: 'Placement Tree Viewer',
  57. chunks: ['chunk-placement-tree-vendors', 'placement-tree'],
  58. }
  59. }
  60. if (ENABLE_PAYMENT_APP === 'true') {
  61. pages['payment'] = {
  62. entry: 'src/thirdparty/payment/main.js',
  63. template: 'public/payment.html',
  64. filename: 'app4/index.html',
  65. title: 'Elken Payment Page',
  66. chunks: ['chunk-payment-vendors', 'payment'],
  67. }
  68. }
  69. if (ENABLE_ELKEN_APP_CENTER === 'true') {
  70. pages['elken-app-center'] = {
  71. entry: 'src/thirdparty/elken-app-center/main.js', // entry point of your application
  72. template: 'public/elken-app-center.html', // template file path
  73. filename: 'elken-app-center/bundle.html', // output path for your index.html // TODO: change done as per hassan request
  74. title: 'Elken App Center', // the title of your application
  75. chunks: ['chunk-elken-app-center-vendors', 'elken-app-center'], // js chunks name. note: chunks name must follow your page name
  76. }
  77. }
  78. }
  79. return pages
  80. },
  81. getPagesSplitChunkCacheGroupsOptimizations: function() {
  82. const IS_VENDOR = /[\\/]node_modules[\\/]/
  83. return {
  84. app: {
  85. name: `chunk-app-vendors`,
  86. priority: -11,
  87. chunks: chunk => chunk.name === 'app',
  88. test: IS_VENDOR,
  89. enforce: true,
  90. },
  91. checkout: {
  92. name: `chunk-checkout-vendors`,
  93. priority: -11,
  94. chunks: chunk => chunk.name === 'checkout',
  95. test: IS_VENDOR,
  96. enforce: true,
  97. },
  98. 'product-list': {
  99. name: `chunk-product-list-vendors`,
  100. priority: -11,
  101. chunks: chunk => chunk.name === 'product-list',
  102. test: IS_VENDOR,
  103. enforce: true,
  104. },
  105. login: {
  106. name: `chunk-login-vendors`,
  107. priority: -11,
  108. chunks: chunk => chunk.name === 'login',
  109. test: IS_VENDOR,
  110. enforce: true,
  111. },
  112. 'placement-tree': {
  113. name: `chunk-placement-tree-vendors`,
  114. priority: -11,
  115. chunks: chunk => chunk.name === 'placement-tree',
  116. test: IS_VENDOR,
  117. enforce: true,
  118. },
  119. payment: {
  120. name: `chunk-payment-vendors`,
  121. priority: -11,
  122. chunks: chunks => chunks.name === 'payment',
  123. test: IS_VENDOR,
  124. enforce: true,
  125. },
  126. 'elken-app-center': {
  127. name: `chunk-elken-app-center-vendors`,
  128. priority: -11,
  129. chunks: chunks => chunks.name === 'elken-app-center',
  130. test: IS_VENDOR,
  131. enforce: true,
  132. },
  133. 'product-viewer': {
  134. name: `chunk-product-viewer-vendors`,
  135. priority: -11,
  136. chunks: chunks => chunks.name === 'product-viewer',
  137. test: IS_VENDOR,
  138. enforce: true,
  139. },
  140. }
  141. },
  142. }