新增: - backend/venv/ - Python 虚拟环境 - backend/start.sh - 启动脚本(使用虚拟环境) - backend/requirements.txt - 依赖列表 - .gitignore - 忽略虚拟环境和缓存文件 说明: - 每个项目使用独立虚拟环境 - 避免依赖冲突 - 启动脚本自动创建和激活虚拟环境
31 lines
897 B
JavaScript
31 lines
897 B
JavaScript
/**
|
|
* Gets the socket integration to use for Webpack messages.
|
|
* @param {'wds' | 'whm' | 'wps' | string} integrationType A valid socket integration type or a path to a module.
|
|
* @returns {string} Path to the resolved socket integration module.
|
|
*/
|
|
function getSocketIntegration(integrationType) {
|
|
let resolvedSocketIntegration;
|
|
switch (integrationType) {
|
|
case 'wds': {
|
|
resolvedSocketIntegration = require.resolve('../../sockets/WDSSocket');
|
|
break;
|
|
}
|
|
case 'whm': {
|
|
resolvedSocketIntegration = require.resolve('../../sockets/WHMEventSource');
|
|
break;
|
|
}
|
|
case 'wps': {
|
|
resolvedSocketIntegration = require.resolve('../../sockets/WPSSocket');
|
|
break;
|
|
}
|
|
default: {
|
|
resolvedSocketIntegration = require.resolve(integrationType);
|
|
break;
|
|
}
|
|
}
|
|
|
|
return resolvedSocketIntegration;
|
|
}
|
|
|
|
module.exports = getSocketIntegration;
|