Skip to content

Commit

Permalink
Use Vite instead or React tools, fix vulnerabilities.
Browse files Browse the repository at this point in the history
Also: rename .JS files to .JSX; change require to import, as require does not work in Vite
  • Loading branch information
strazdinsg committed Jul 24, 2024
1 parent 54e539c commit 0e21a7f
Show file tree
Hide file tree
Showing 42 changed files with 8,992 additions and 131,172 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ export default defineConfig({
port: 3000
},
build: {
outDir: "../build"
outDir: "build"
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<link rel="icon" href="public/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>React class-component example</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="module" src="src/index.jsx"></script>
</body>
</html>
28,166 changes: 1,910 additions & 26,256 deletions public_html/examples/react/03-class-components/package-lock.json

Large diffs are not rendered by default.

32 changes: 8 additions & 24 deletions public_html/examples/react/03-class-components/package.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,16 @@
{
"name": "class-components",
"version": "0.1.0",
"version": "2.0.0",
"private": true,
"dependencies": {
"react": "18.0.0",
"react-dom": "18.0.0",
"react-scripts": "5.0.1",
"webpack": "^5.93.0"
"react": "^18.3.1",
"react-dom": "^18.3.1",
"vite": "^5.3.4",
"@vitejs/plugin-react": "^4.3.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build"
},
"eslintConfig": {
"extends": [
"react-app"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
"start": "vite",
"build": "vite build",
"serve": "vite preview"
}
}
13 changes: 13 additions & 0 deletions public_html/examples/react/03-class-components/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import {defineConfig} from 'vite';
import react from '@vitejs/plugin-react';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
server: {
port: 3000
},
build: {
outDir: "build"
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<link rel="icon" href="public/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>React function-component example</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="module" src="src/index.jsx"></script>
</body>
</html>
Loading

0 comments on commit 0e21a7f

Please sign in to comment.