Skip to content

Commit a96a0a7

Browse files
committed
Replaced CRA with Vite... resolving all package audits and greatly reduced dependency tree.
1 parent 949a644 commit a96a0a7

File tree

7 files changed

+7389
-22991
lines changed

7 files changed

+7389
-22991
lines changed

example/react/public/index.html renamed to example/react/index.html

+4-12
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,16 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />
5-
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
5+
<link rel="icon" href="/favicon.ico" />
66
<meta name="viewport" content="width=device-width, initial-scale=1" />
77
<meta name="theme-color" content="#000000" />
88
<meta name="description" content="Web site created using create-react-app" />
9-
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
9+
<link rel="apple-touch-icon" href="/logo192.png" />
1010
<!--
1111
manifest.json provides metadata used when your web app is installed on a
1212
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
1313
-->
14-
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
15-
<!--
16-
Notice the use of %PUBLIC_URL% in the tags above.
17-
It will be replaced with the URL of the `public` folder during the build.
18-
Only files inside the `public` folder can be referenced from the HTML.
19-
20-
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
21-
work correctly both with client-side routing and a non-root public URL.
22-
Learn how to configure a non-root public URL by running `npm run build`.
23-
-->
14+
<link rel="manifest" href="/manifest.json" />
2415
<title>React App</title>
2516
</head>
2617
<body>
@@ -36,5 +27,6 @@
3627
To begin the development, run `npm start` or `yarn start`.
3728
To create a production bundle, use `npm run build` or `yarn build`.
3829
-->
30+
<script type="module" src="/src/index.jsx"></script>
3931
</body>
4032
</html>

example/react/package.json

+7-6
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"private": true,
44
"version": "3.0.0-dev",
55
"scripts": {
6-
"start": "react-scripts start",
7-
"build": "react-scripts build",
8-
"eject": "react-scripts eject"
6+
"start": "vite",
7+
"build": "vite build",
8+
"preview": "vite preview"
99
},
1010
"eslintConfig": {
1111
"extends": [
@@ -29,14 +29,15 @@
2929
"@testing-library/jest-dom": "^6.4.2",
3030
"@testing-library/react": "^14.2.2",
3131
"@testing-library/user-event": "^14.5.2",
32-
"react-scripts": "^5.0.1"
32+
"@vitejs/plugin-react": "^4.2.1",
33+
"vite": "^5.2.6"
3334
},
3435
"dependencies": {
3536
"@exceptionless/react": "3.0.0-dev",
3637
"react": "^18.2.0",
37-
"react-dom": "^18.2.0",
38-
"web-vitals": "^3.5.2"
38+
"react-dom": "^18.2.0"
3939
},
40+
"type": "module",
4041
"publishConfig": {
4142
"access": "restricted"
4243
}
File renamed without changes.

example/react/src/index.js renamed to example/react/src/index.jsx

-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React from "react";
22
import { createRoot } from "react-dom/client";
33
import "./index.css";
44
import App from "./App";
5-
import reportWebVitals from "./reportWebVitals";
65

76
const container = document.getElementById("root");
87
const root = createRoot(container);
@@ -12,8 +11,3 @@ root.render(
1211
<App />
1312
</React.StrictMode>
1413
);
15-
16-
// If you want to start measuring performance in your app, pass a function
17-
// to log results (for example: reportWebVitals(console.log))
18-
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
19-
reportWebVitals();

example/react/src/reportWebVitals.js

-13
This file was deleted.

example/react/vite.config.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { defineConfig } from "vite";
2+
import react from "@vitejs/plugin-react";
3+
4+
export default defineConfig({
5+
base: "",
6+
plugins: [react()],
7+
server: {
8+
open: true,
9+
port: 5174
10+
}
11+
});

0 commit comments

Comments
 (0)