0

I want to build my project with npm run build and when I build my project, all files are build correctly and CSS file,favicon,manifest,js file are load.

But my js file does not show anything.

I am using BrowserRouter

I don't use webpack

This is my Route file:

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>
    );
  }
}

What should I do?

Pramod
  • 424
  • 2
  • 7
  • 28
Matt Rose
  • 151
  • 2
  • 3
  • 7
  • You want to build your project with `npm run build`, but you don't want to use Webpack. What development environment/build step are you using? – Tholle Jul 16 '18 at 11:33
  • what do you mean about this sentence : What development environment/build step are you using? – Matt Rose Jul 16 '18 at 11:38
  • please explain more – Matt Rose Jul 16 '18 at 11:39
  • @MohammadMehdi You want to build the project ? Do you understand the meaning of build ? What are you trying to achieve ? I think and hope you want to pack all the related codes in a single file . Is it so ? – Amar Pathak Jul 16 '18 at 12:35
  • Which bundling tool is you using? prepack? other version of webpack? @MohammadMehdi – PlayMa256 Jul 16 '18 at 13:09

0 Answers0