-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Expand file tree
/
Copy pathindex.js
More file actions
44 lines (39 loc) · 1.33 KB
/
index.js
File metadata and controls
44 lines (39 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/**
* Entry point for development and production PWA builds.
*/
import 'regenerator-runtime/runtime';
import './setRuntimePublicPath';
import { createRoot } from 'react-dom/client';
import App from './App';
import React from 'react';
/**
* EXTENSIONS AND MODES
* =================
* pluginImports.js is dynamically generated from extension and mode
* configuration at build time.
*
* pluginImports.js imports all of the modes and extensions and adds them
* to the window for processing.
*/
import { modes as defaultModes, extensions as defaultExtensions } from './pluginImports';
import loadDynamicConfig from './loadDynamicConfig';
export { history } from './utils/history';
export { preserveQueryParameters, preserveQueryStrings } from './utils/preserveQueryParameters';
loadDynamicConfig(window.config).then(config_json => {
// Reset Dynamic config if defined
if (config_json !== null) {
window.config = config_json;
}
/**
* Combine our appConfiguration with installed extensions and modes.
* In the future appConfiguration may contain modes added at runtime.
* */
const appProps = {
config: window ? window.config : {},
defaultExtensions,
defaultModes,
};
const container = document.getElementById('root');
const root = createRoot(container);
root.render(React.createElement(App, appProps));
});