MCPcopy Index your code
hub / github.com/OpenCoworkAI/open-codesign / needsJsxRuntimeInHtml

Function needsJsxRuntimeInHtml

packages/runtime/src/index.ts:412–423  ·  view source on GitHub ↗
(html: string)

Source from the content-addressed store, hash-verified

410// viable; pure HTML + CDN-library pages (Chart.js etc.) match no signal and
411// pay zero inline-script cost.
412function needsJsxRuntimeInHtml(html: string): boolean {
413 return (
414 hasTextBabelScript(html) ||
415 html.includes('ReactDOM.createRoot') ||
416 html.includes('React.createElement') ||
417 html.includes('IOSDevice') ||
418 html.includes('DesignCanvas') ||
419 html.includes('AppleWatchUltra') ||
420 html.includes('AndroidPhone') ||
421 html.includes('MacOSSafari')
422 );
423}
424
425function hasTextBabelScript(html: string): boolean {
426 let found = false;

Callers 3

requiresPreviewScriptsFunction · 0.85
buildPreviewDocumentFunction · 0.85
buildStandaloneDocumentFunction · 0.85

Calls 1

hasTextBabelScriptFunction · 0.85

Tested by

no test coverage detected