Correction chargement dynamique

This commit is contained in:
wpetit 2020-10-13 12:08:43 +02:00
parent f752865d33
commit f2d6a72204
3 changed files with 15 additions and 8 deletions

View File

@ -9,14 +9,14 @@ import { createClient } from '../util/apollo';
import { ApolloProvider } from '@apollo/client';
import { AppLoader } from './AppLoader';
const LazyHomePage = React.lazy(() => import('./HomePage/HomePage'));
const LazyDashboardPage = React.lazy(() => import('./DashboardPage/DashboardPage'));
const LazyUnauthorizedPage = React.lazy(() => import('./UnauthorizedPage/UnauthorizedPage'));
const LazyConferencePage = React.lazy(() => import('./ConferencePage/ConferencePage'));
const LazyDecisionSupportFilePage = React.lazy(() => import('./DecisionSupportFilePage/DecisionSupportFilePage'));
const LazyProfilePage = React.lazy(() => import('./ProfilePage/ProfilePage'));
const LazyWorkgroupPage = React.lazy(() => import('./WorkgroupPage/WorkgroupPage'));
const LazyLogoutPage = React.lazy(() => import('./LogoutPage'));
const LazyHomePage = React.lazy(() => import(/* webpackChunkName: "HomePage" */'./HomePage/HomePage'));
const LazyDashboardPage = React.lazy(() => import(/* webpackChunkName: "DashboardPage" */'./DashboardPage/DashboardPage'));
const LazyUnauthorizedPage = React.lazy(() => import(/* webpackChunkName: "UnauthorizedPage" */'./UnauthorizedPage/UnauthorizedPage'));
const LazyConferencePage = React.lazy(() => import(/* webpackChunkName: "ConferencePage" */'./ConferencePage/ConferencePage'));
const LazyDecisionSupportFilePage = React.lazy(() => import(/* webpackChunkName: "DecisionSupportFilePage" */'./DecisionSupportFilePage/DecisionSupportFilePage'));
const LazyProfilePage = React.lazy(() => import(/* webpackChunkName: "ProfilePage" */'./ProfilePage/ProfilePage'));
const LazyWorkgroupPage = React.lazy(() => import(/* webpackChunkName: "WorkgroupPage" */'./WorkgroupPage/WorkgroupPage'));
const LazyLogoutPage = React.lazy(() => import(/* webpackChunkName: "LogoutPage" */'./LogoutPage'));
export interface AppProps {

View File

@ -4,6 +4,7 @@ export const Config = {
graphQLEndpoint: get<string>("graphQLEndpoint", "http://localhost:8081/api/v1/graphql"),
subscriptionEndpoint: get<string>("subscriptionEndpoint", "ws://localhost:8081/api/v1/graphql"),
conferenceHeartbeatInterval: get<number>("conferenceHeartbeatInterval", 10000),
frontendBaseURL: get<string>("frontendBaseURL", window.location.protocol + '//' + window.location.host + '/'),
};
function get<T>(key: string, defaultValue: T):T {

View File

@ -1,3 +1,8 @@
import { Config } from './config';
declare var __webpack_public_path__: string;
__webpack_public_path__ = Config.frontendBaseURL;
import './sass/_all.scss';
import React from 'react';
import ReactDOM from 'react-dom';
@ -9,6 +14,7 @@ import '@fortawesome/fontawesome-free/js/regular'
import '@fortawesome/fontawesome-free/js/brands'
import './resources/favicon.png';
ReactDOM.render(
<App />,
document.getElementById('app')