-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #161 from Phanindra-tw/master
Add Webpack & babel and create a HomePage Component
- Loading branch information
Showing
10 changed files
with
2,512 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"presets": [ | ||
"@babel/preset-env", | ||
"@babel/preset-react" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React, { Component } from 'react'; | ||
import { BrowserRouter, Route, Switch } from 'react-router-dom'; | ||
import CreatePerson from './CreatePerson'; | ||
import PersonDashboard from './PersonDashboard'; | ||
import './HomePage.css'; | ||
import EditPerson from './EditPerson'; | ||
|
||
class App extends Component { | ||
render() { | ||
return ( | ||
<BrowserRouter basename="/person-management"> | ||
<Switch> | ||
<Route path="/new" exact component={CreatePerson} /> | ||
<Route path="/search" exact component={PersonDashboard} /> | ||
<Route path="/edit/:uuid" exact component={EditPerson} /> | ||
<Route path="/" component={PersonDashboard} /> | ||
</Switch> | ||
</BrowserRouter> | ||
); | ||
} | ||
} | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import './index.css'; | ||
import App from './App'; | ||
import registerServiceWorker from './registerServiceWorker'; | ||
|
||
ReactDOM.render( | ||
<App />, | ||
|
||
document.getElementById('root') | ||
); | ||
registerServiceWorker(); | ||
export { default as HomePage } from './containers/HomePage'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
const path = require('path'); | ||
const HtmlWebpackPlugin = require('html-webpack-plugin'); | ||
|
||
module.exports = { | ||
entry: { | ||
index: './src/index.js' | ||
}, // Entry point of your application | ||
output: { | ||
path: path.resolve(__dirname, 'dist'), // Output directory | ||
library: "PersonManagementApp", | ||
libraryTarget: "umd", | ||
umdNamedDefine: true, | ||
clean: true, | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.(js|jsx)$/, | ||
exclude: /node_modules/, | ||
use: { | ||
loader: 'babel-loader' // Use Babel for JavaScript and JSX files | ||
}, | ||
resolve: { | ||
fullySpecified: false, | ||
}, | ||
}, | ||
{ | ||
test: /\.css$/, | ||
use: ['style-loader', 'css-loader'] // Use style-loader and css-loader for CSS files | ||
}, | ||
{ | ||
test: /\.svg$/, | ||
use: ['svg-inline-loader'] // Use svg-inline-loader for SVG files | ||
}, | ||
{ | ||
test: /\.(png|jpg|gif)$/, | ||
use: [ | ||
{ | ||
loader: 'file-loader', // Use file-loader for other file types like images | ||
options: { | ||
name: '[name].[ext]', | ||
outputPath: 'images/' | ||
} | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
plugins: [ | ||
new HtmlWebpackPlugin({ | ||
template: './public/index.html' // HTML template | ||
}) | ||
], | ||
resolve: { | ||
extensions: ['.ts', '.js'], | ||
} | ||
}; |
Oops, something went wrong.