refactor: AppContext and App entrypoints
This commit is contained in:
parent
442e7cd8d9
commit
dd0abc8a8b
7 changed files with 32 additions and 10 deletions
|
|
@ -1,10 +1,28 @@
|
|||
import React from 'react'
|
||||
import ReactDOM from 'react-dom'
|
||||
|
||||
import App from './App'
|
||||
import * as serviceWorker from './serviceWorker'
|
||||
|
||||
ReactDOM.render(<App />, document.getElementById('root'))
|
||||
function importBuildTarget() {
|
||||
if (process.env.REACT_APP_BUILD_TARGET === 'LAMASSU') {
|
||||
return import('./App')
|
||||
} else if (process.env.REACT_APP_BUILD_TARGET === 'PAZUZ') {
|
||||
return import('./pazuz/App')
|
||||
} else {
|
||||
return Promise.reject(
|
||||
new Error('No such build target: ' + process.env.REACT_APP_BUILD_TARGET)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
importBuildTarget().then(({ default: Environment }) =>
|
||||
ReactDOM.render(
|
||||
<React.StrictMode>
|
||||
<Environment />
|
||||
</React.StrictMode>,
|
||||
document.getElementById('root')
|
||||
)
|
||||
)
|
||||
|
||||
// If you want your app to work offline and load faster, you can change
|
||||
// unregister() to register() below. Note this comes with some pitfalls.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue