2019-08-13 21:36:46 +02:00
|
|
|
/**
|
|
|
|
|
* Entry point for development and production PWA builds.
|
|
|
|
|
*/
|
2019-09-04 19:53:13 +02:00
|
|
|
import 'regenerator-runtime/runtime';
|
2024-05-27 20:30:25 +02:00
|
|
|
import { createRoot } from 'react-dom/client';
|
2022-11-10 19:29:55 +01:00
|
|
|
import App from './App';
|
2019-08-13 21:36:46 +02:00
|
|
|
import React from 'react';
|
2023-04-27 16:46:23 +02:00
|
|
|
|
2020-05-07 16:19:58 +02:00
|
|
|
/**
|
2022-04-06 19:28:42 +02:00
|
|
|
* EXTENSIONS AND MODES
|
2020-05-07 16:19:58 +02:00
|
|
|
* =================
|
2022-04-06 19:28:42 +02:00
|
|
|
* pluginImports.js is dynamically generated from extension and mode
|
|
|
|
|
* configuration at build time.
|
2020-05-07 16:19:58 +02:00
|
|
|
*
|
2022-04-06 19:28:42 +02:00
|
|
|
* pluginImports.js imports all of the modes and extensions and adds them
|
|
|
|
|
* to the window for processing.
|
2020-05-07 16:19:58 +02:00
|
|
|
*/
|
2023-09-01 22:19:39 +02:00
|
|
|
import { modes as defaultModes, extensions as defaultExtensions } from './pluginImports';
|
2023-05-15 20:52:48 +02:00
|
|
|
import loadDynamicConfig from './loadDynamicConfig';
|
2025-03-27 21:47:16 +01:00
|
|
|
import { publicUrl } from './utils/publicUrl';
|
2025-01-13 16:49:08 +01:00
|
|
|
export { history } from './utils/history';
|
|
|
|
|
export { preserveQueryParameters, preserveQueryStrings } from './utils/preserveQueryParameters';
|
2020-05-07 16:19:58 +02:00
|
|
|
|
2023-05-15 20:52:48 +02:00
|
|
|
loadDynamicConfig(window.config).then(config_json => {
|
|
|
|
|
// Reset Dynamic config if defined
|
|
|
|
|
if (config_json !== null) {
|
|
|
|
|
window.config = config_json;
|
|
|
|
|
}
|
2025-03-27 21:47:16 +01:00
|
|
|
window.config.routerBasename ||= publicUrl;
|
2023-05-15 20:52:48 +02:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 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,
|
|
|
|
|
};
|
2019-08-13 21:36:46 +02:00
|
|
|
|
2024-05-27 20:30:25 +02:00
|
|
|
const container = document.getElementById('root');
|
|
|
|
|
|
|
|
|
|
const root = createRoot(container);
|
|
|
|
|
root.render(React.createElement(App, appProps));
|
2023-05-15 20:52:48 +02:00
|
|
|
});
|