Skip to content

Commit a69de04

Browse files
Ashish KumarAshish Kumar
authored andcommitted
CHORE: Setup completed
0 parents  commit a69de04

28 files changed

+10204
-0
lines changed

.babelrc

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"presets": [
3+
[
4+
"@babel/preset-env", {
5+
"modules": false,
6+
"targets": [
7+
"last 3 versions", "not dead", "not < 1%"
8+
],
9+
// "useBuiltIns": "usage"
10+
}
11+
],
12+
"@babel/preset-react"
13+
],
14+
"plugins": [
15+
"@loadable/babel-plugin",
16+
"@babel/plugin-transform-runtime",
17+
"@babel/syntax-dynamic-import",
18+
[
19+
"@babel/plugin-proposal-class-properties", {
20+
"loose": true
21+
}
22+
]
23+
],
24+
"env": {
25+
"prod": {
26+
"plugins": [
27+
[
28+
"transform-react-remove-prop-types", {
29+
"mode": "wrap",
30+
"ignoreFilenames": ["node_modules"]
31+
}
32+
]
33+
]
34+
}
35+
}
36+
}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/client-build
2+
/server-build
3+
/node_modules

client/App.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React, {Component} from "react";
2+
import { renderRoutes } from "react-router-config";
3+
import Routes from "./Routes";
4+
5+
class App extends Component {
6+
render() {
7+
return (
8+
<div className="page--container">
9+
{renderRoutes(Routes)}
10+
</div>
11+
);
12+
}
13+
}
14+
15+
export default App;

client/AppContainer.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import React, {Component} from "react";
2+
import {renderRoutes} from "react-router-config";
3+
4+
5+
class AppContainer extends Component {
6+
render() {
7+
return (
8+
<React.Fragment>
9+
{renderRoutes(this.props.route.routes)}
10+
</React.Fragment>
11+
);
12+
}
13+
}
14+
15+
16+
export default AppContainer;

client/Routes.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import React from "react";
2+
import loadable from '@loadable/component';
3+
4+
const Loading = () => <h1>Loading...</h1>;
5+
6+
const AppContainer = loadable(() => import(/* webpackChunkName: "appcontainer", webpackPrefetch: true */ "./AppContainer"),{
7+
fallback: Loading,
8+
ssr: true
9+
});
10+
11+
const Home = loadable(() => import(/* webpackChunkName: "home", webpackPrefetch: true */ "./containers/Home"),{
12+
fallback: Loading,
13+
ssr: true
14+
});
15+
16+
17+
export default [
18+
{
19+
component: AppContainer,
20+
routes: [
21+
{
22+
exact: false,
23+
path: "/",
24+
component: Home,
25+
},
26+
]
27+
}
28+
];

client/actions/index.js

Whitespace-only changes.

client/api/index.js

Whitespace-only changes.

client/config/api.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import axios from 'axios';
2+
3+
const axiosInstance = axios.create({
4+
baseURL: `/api`,
5+
});
6+
7+
export default axiosInstance;

client/config/appConfig.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default {
2+
appBaseName: "/"
3+
}

client/config/history.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import {createBrowserHistory} from "history";
2+
import appConfig from "./appConfig";
3+
4+
const history = createBrowserHistory({
5+
basename: appConfig.appBaseName
6+
});
7+
8+
export default history;

0 commit comments

Comments
 (0)