15 lines
674 B
JavaScript
15 lines
674 B
JavaScript
import { config } from '../../config.js';
|
|
import { detectProject } from '../../lib/frameworks/detect.js';
|
|
import { ReactAdapter } from '../../lib/frameworks/react.js';
|
|
export function requireReact() {
|
|
const detected = detectProject(config.workspaceRoot);
|
|
if (detected.frontend instanceof ReactAdapter) {
|
|
return detected.frontend;
|
|
}
|
|
if (detected.primary instanceof ReactAdapter) {
|
|
return detected.primary;
|
|
}
|
|
throw new Error('No React project detected in WORKSPACE_ROOT. ' +
|
|
'Expected a package.json with a react dependency (or react-scripts/vite/next config) at the workspace root.');
|
|
}
|
|
//# sourceMappingURL=requireReact.js.map
|