chore(webpack-react): organize folder structure

This commit is contained in:
dancingCycle 2022-07-18 15:19:42 +02:00
parent 2b05256770
commit b7b1a9630f
3 changed files with 13 additions and 3 deletions

10
webpack-react/app/app.jsx Normal file
View File

@ -0,0 +1,10 @@
import React from 'react';
import Home from './pages/home';
export default function App() {
return (
<div>
<h1>Auth0 with React.js</h1>
<Home />
</div>
)
}

View File

@ -1,6 +1,6 @@
import React from 'react';
import ReactDOM from 'react-dom';
import Home from './pages/home';
import App from './app';
//TODO remove debugging
if (process.env.NODE_ENV !== 'production') {
console.log('development mode');
@ -10,4 +10,4 @@ import { createRoot } from 'react-dom/client';
//create root container
const root = createRoot(document.getElementById("root"));
//render root app
root.render(<Home />);
root.render(<App />);

View File

@ -4,7 +4,7 @@ const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');
module.exports = {
//bundle *.js from this entry point
entry: path.resolve(__dirname, '../app/index.js'),
entry: path.resolve(__dirname, '../app/index.jsx'),
//create output file to be linked to index.html
output: {
filename: '[name].bundle.js',