feat: migrate to vite

This commit is contained in:
karishmas6
2024-10-24 22:23:41 +05:30
parent c7b704800b
commit d8c46297d3
4 changed files with 46 additions and 31 deletions

21
index.html Normal file
View File

@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using Vite"
/>
<link rel="apple-touch-icon" href="/logo192.png" />
<link rel="manifest" href="/manifest.json" />
<title>Browser Recorder</title>
</head>
<body>
<script type="module" src="/src/index.tsx"></script>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!-- Vite will automatically inject the necessary scripts here during the build -->
</body>
</html>

View File

@@ -11,15 +11,13 @@
"@mui/lab": "^5.0.0-alpha.80", "@mui/lab": "^5.0.0-alpha.80",
"@mui/material": "^5.6.2", "@mui/material": "^5.6.2",
"@react-oauth/google": "^0.12.1", "@react-oauth/google": "^0.12.1",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.1.1", "@testing-library/react": "^13.1.1",
"@testing-library/user-event": "^13.5.0", "@testing-library/user-event": "^13.5.0",
"@types/bcrypt": "^5.0.2", "@types/bcrypt": "^5.0.2",
"@types/body-parser": "^1.19.5", "@types/body-parser": "^1.19.5",
"@types/csurf": "^1.11.5", "@types/csurf": "^1.11.5",
"@types/jest": "^27.4.1",
"@types/jsonwebtoken": "^9.0.7", "@types/jsonwebtoken": "^9.0.7",
"@types/node": "^16.11.27", "@types/node": "22.7.9",
"@types/react": "^18.0.5", "@types/react": "^18.0.5",
"@types/react-dom": "^18.0.1", "@types/react-dom": "^18.0.1",
"@types/uuid": "^8.3.4", "@types/uuid": "^8.3.4",
@@ -55,9 +53,7 @@
"react-dom": "^18.0.0", "react-dom": "^18.0.0",
"react-highlight": "0.15.0", "react-highlight": "0.15.0",
"react-router-dom": "^6.26.1", "react-router-dom": "^6.26.1",
"react-scripts": "5.0.1",
"react-simple-code-editor": "^0.11.2", "react-simple-code-editor": "^0.11.2",
"react-split": "^2.0.14",
"react-transition-group": "^4.4.2", "react-transition-group": "^4.4.2",
"sequelize": "^6.37.3", "sequelize": "^6.37.3",
"sequelize-typescript": "^2.1.6", "sequelize-typescript": "^2.1.6",
@@ -72,46 +68,33 @@
"winston": "^3.5.1" "winston": "^3.5.1"
}, },
"scripts": { "scripts": {
"start": "concurrently -k \"npm run server\" \"npm run client\"", "start": "concurrently -k \"npm run server\" \"npm run client\"",
"server": "./node_modules/.bin/nodemon server/src/server.ts", "server": "./node_modules/.bin/nodemon server/src/server.ts",
"client": "react-app-rewired start", "client": "vite",
"build": "react-app-rewired build", "build": "vite build",
"test": "react-app-rewired test", "test": "vite preview",
"eject": "react-scripts eject", "lint": "./node_modules/.bin/eslint ."
"lint": "./node_modules/.bin/eslint ." },
},
"eslintConfig": { "eslintConfig": {
"extends": [ "extends": [
"react-app", "react-app"
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
] ]
}, },
"devDependencies": { "devDependencies": {
"@types/cookie-parser": "^1.4.7", "@types/cookie-parser": "^1.4.7",
"@types/express": "^4.17.13", "@types/express": "^4.17.13",
"@types/loglevel": "^1.6.3", "@types/loglevel": "^1.6.3",
"@types/node": "^17.0.15", "@types/node": "22.7.9",
"@types/node-cron": "^3.0.11", "@types/node-cron": "^3.0.11",
"@types/prismjs": "^1.26.0", "@types/prismjs": "^1.26.0",
"@types/react-highlight": "^0.12.5", "@types/react-highlight": "^0.12.5",
"@types/react-transition-group": "^4.4.4", "@types/react-transition-group": "^4.4.4",
"@types/styled-components": "^5.1.23", "@types/styled-components": "^5.1.23",
"@vitejs/plugin-react": "^4.3.3",
"ajv": "^8.8.2", "ajv": "^8.8.2",
"concurrently": "^7.0.0", "concurrently": "^7.0.0",
"nodemon": "^2.0.15", "nodemon": "^2.0.15",
"react-app-rewired": "^2.2.1", "ts-node": "^10.4.0",
"ts-node": "^10.4.0" "vite": "^5.4.10"
} }
} }

View File

@@ -1,6 +1,6 @@
{ {
"compilerOptions": { "compilerOptions": {
"target": "es6", "target": "esnext",
"lib": ["dom", "dom.iterable", "esnext"], "lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true, "allowJs": true,
"skipLibCheck": true, "skipLibCheck": true,

11
vite.config.js Normal file
View File

@@ -0,0 +1,11 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
export default defineConfig(() => {
return {
build: {
outDir: 'build',
},
plugins: [react()],
};
});