我想构建我的项目,npm run build
当我构建我的项目时,所有文件都正确构建并加载 CSS 文件、favicon、manifest、js 文件。
但我的js 文件没有显示任何内容。
我正在使用浏览器路由器
我不使用 webpack
这是我的路线文件:
import React , { Component } from 'react';
import OnePage from './OnePage/OnePage';
import Blog from './OnePage/Blog/Blog';
import Blogs from './OnePage/Blogs/Blogs';
import Home from './WebApp/Routes/Home';
import Register from './WebApp/Routes/Register/Register';
import Buy from './WebApp/Routes/Buy/Buy';
import Profile from './WebApp/Routes/Profile/Profile';
import Support from './WebApp/Routes/Support/Support';
import Search from './WebApp/Routes/Search/Search';
import SearchCategories from './WebApp/Routes/Search/SearchCategories';
import Users from './WebApp/Routes/Users/Users';
import Suggestion from './WebApp/Routes/Suggestion/Suggestion';
import './../public/appStyle.css';
import { Route, BrowserRouter as Router } from 'react-router-dom';
export default class App extends Component {
render(){
return(
<Router>
<div>
<Route exact path="/" component={OnePage}/>
<Route exact path="/app/" component={Home}/>
<Route exact path="/blog/:id" component={Blog}/>
<Route path="/blogs" component={Blogs}/>
<Route path="/app/register" component={Register}/>
<Route path="/app/buy" component={Buy}/>
<Route path="/app/profile/:id" component={Profile}/>
<Route path="/app/support" component={Support}/>
<Route path="/app/search" component={Search}/>
<Route path="/app/categories/:id" component={SearchCategories}/>
<Route path="/app/users" component={Users}/>
<Route path="/app/suggestion" component={Suggestion}/>
</div>
</Router>
);
}
}
我应该怎么办?