我正在尝试启动一个单页面的webapp,但是在使Firebase正常运行时遇到了一些问题。我使用create-react-app最初创建了项目。
本质上发生的是index.html已加载,但未呈现该应用程序。您可以在这里看到:https://pokerstudy.online/
index.js:
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import * as serviceWorker from './serviceWorker';
import {BrowserRouter} from 'react-router-dom';
import ReactGA from 'react-ga';
import firebase from 'firebase';
ReactGA.intialize('UA-134743808-1', { standardImplementation: true });
ReactGA.pageview(window.location.pathname + window.location.search);
ReactDOM.render(<BrowserRouter><App /></BrowserRouter>, document.getElementById('root'));
serviceWorker.unregister();
firebase.json
{
"hosting": {
"public": "build",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
},
"storage": {
"rules": "storage.rules"
}
}
任何帮助将不胜感激!