配置环境变量
REACT_APP_BUILD = "HelloWorld"
// entrypoints/hello-world
import React from 'react';
import HelloWorldCom from '../view/components/hello-world'
const HelloWorld =()=>{
return <HelloWorldCom/>
}
export default HelloWorld;
function bootstrap() {
switch(process.env.REACT_APP_BUILD) {
case "HelloWorld": return import("./entrypoints/hello-world");
default: return import("./entrypoints/wmb-openness")
}
}
export default bootstrap
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import reportWebVitals from './reportWebVitals';
import {BrowserRouter} from 'react-router-dom'
import Routes from './route/route';
import bootstrap from "./bootstrap";
bootstrap().then(({ default: App }) => ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
));
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();