getIntegrationEntry.js 606 B

12345678910111213141516171819202122
  1. /**
  2. * Gets entry point of a supported socket integration.
  3. * @param {'wds' | 'whm' | 'wps' | string} integrationType A valid socket integration type or a path to a module.
  4. * @returns {string | undefined} Path to the resolved integration entry point.
  5. */
  6. function getIntegrationEntry(integrationType) {
  7. let resolvedEntry;
  8. switch (integrationType) {
  9. case 'whm': {
  10. resolvedEntry = 'webpack-hot-middleware/client';
  11. break;
  12. }
  13. case 'wps': {
  14. resolvedEntry = 'webpack-plugin-serve/client';
  15. break;
  16. }
  17. }
  18. return resolvedEntry;
  19. }
  20. module.exports = getIntegrationEntry;