Advertisement
Guest User

Untitled

a guest
Jul 24th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. const path = require('path');
  2.  
  3. // this comes from maven env
  4. const TENANT = process.env.NPM_FRONTEND_MODULE_BASE_DIR;
  5. const TENANT_NAME = TENANT.split('/').reverse()[2];
  6. const TENANT_COMPONENTS = TENANT.substr(0, TENANT.lastIndexOf('/'));
  7. const PROJECT_ID = 'project-id';
  8.  
  9. console.log(`############## FRONTEND BUILD ##############`);
  10. console.log(`############## STARTING BUILD FOR TENANT: ${TENANT_NAME} ##############`);
  11. console.log(`############## ******* ##############`);
  12.  
  13. const CONSTANTS = {
  14. SUFFIX_SOURCE: '.entry',
  15. SUFFIX_TARGET: '.bundle',
  16. SUFFIX_AUTHOR: 'author', // eg: author.bundle.js, dialog.author.bundle.js
  17. // Project root (relative to config folder)
  18. BASE_DIR: '../../',
  19. // Partial from tenant package (subproject id)
  20. TENANTS_PACKAGE: `${TENANT}`,
  21. // Path to frontend working directory (or where the package.json is at) (relative to BASE_DIR)
  22. FRONTEND_PACKAGE: '',
  23. // Path to tenant root
  24. PROJECT_COMMONS: `apps/${PROJECT_ID}`,
  25. // Path to shared and abstracts include
  26. SHARED_INCLUDE: 'commons/shared',
  27. // Path to vendor (js) code alias
  28. VENDORS_INCLUDE: 'commons/vendor',
  29. // Path to assets (such as svg icons)
  30. ASSETS_INCLUDE: 'theme/assets',
  31. // Path to dialogs styles include
  32. DIALOG_CSS_INCLUDE: 'dialog',
  33. // Path to tenants package
  34. TENANTS_COMPONENTS_INCLUDE: `${TENANTS_COMPONENTS}`,
  35. // Path to components package
  36. COMPONENTS_INCLUDE: 'components',
  37. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement