Skip to content

Commit db4e194

Browse files
author
Nora Tarano
committed
[fix][compile] Ensure root component is always present
1 parent 43086e2 commit db4e194

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

scripts/buildCSS.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ registerCSSInterfaceWithDefaultTheme();
2020
const path = './scripts/renderAllComponents.jsx';
2121
const CSS = compileCSS(path);
2222

23+
if (CSS === '') {
24+
throw new Error('Failed to compile CSS');
25+
} else {
26+
console.log('CSS compilation complete.');
27+
}
28+
2329
const format = new CleanCSS({
2430
level: optimizeForProduction ? 2 : 0,
2531
format: 'beautify',

scripts/renderAllComponents.jsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ import DateRangePickerWrapper from '../examples/DateRangePickerWrapper';
55
import SingleDatePickerWrapper from '../examples/SingleDatePickerWrapper';
66
import PresetDateRangePickerWrapper from '../examples/PresetDateRangePicker';
77

8+
if (!document.getElementById('root')) {
9+
// Make sure the #root element is defined
10+
const root = document.createElement('div');
11+
root.id = 'root';
12+
document.body.appendChild(root);
13+
}
14+
815
function App() {
916
return (
1017
<div>

0 commit comments

Comments
 (0)