Skip to content

Commit 6bc3c88

Browse files
authored
Merge pull request #3 from ucfx/to-vite
⭐ Migrate CRA to Vite
2 parents 9ce2867 + a984477 commit 6bc3c88

File tree

9 files changed

+2695
-29374
lines changed

9 files changed

+2695
-29374
lines changed

.eslintrc.cjs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module.exports = {
2+
root: true,
3+
env: { browser: true, es2020: true },
4+
extends: [
5+
'eslint:recommended',
6+
'plugin:react/recommended',
7+
'plugin:react/jsx-runtime',
8+
'plugin:react-hooks/recommended',
9+
],
10+
ignorePatterns: ['dist', '.eslintrc.cjs'],
11+
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
12+
settings: { react: { version: '18.2' } },
13+
plugins: ['react-refresh'],
14+
rules: {
15+
'react/jsx-no-target-blank': 'off',
16+
'react-refresh/only-export-components': [
17+
'warn',
18+
{ allowConstantExport: true },
19+
],
20+
},
21+
}

public/index.html renamed to index.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,18 @@
33

44
<head>
55
<meta charset="utf-8" />
6-
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6+
<link rel="icon" type="image/svg+xml" href="/favicon.ico" />
77
<meta name="viewport" content="width=device-width, initial-scale=1" />
88
<meta name="description" content="Tic Tac Toe Game Using React.js" />
99

10-
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
11-
1210
<title>TIC TAC TOE</title>
1311
</head>
1412

1513
<body>
1614
<noscript>You need to enable JavaScript to run this app.</noscript>
1715
<div id="root"></div>
1816

17+
<script type="module" src="/src/main.jsx"></script>
1918
</body>
2019

2120
</html>

package-lock.json

Lines changed: 0 additions & 29322 deletions
This file was deleted.

package.json

Lines changed: 16 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,44 +3,26 @@
33
"name": "tic-tac-toe-game",
44
"version": "0.1.0",
55
"private": true,
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "vite build",
9+
"lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
10+
"preview": "vite preview"
11+
},
612
"dependencies": {
7-
"@testing-library/jest-dom": "^5.16.5",
8-
"@testing-library/react": "^13.3.0",
9-
"@testing-library/user-event": "^13.5.0",
10-
"framer-motion": "^7.2.1",
13+
"framer-motion": "^11.1.9",
1114
"react": "^18.2.0",
1215
"react-dom": "^18.2.0",
13-
"react-scripts": "5.0.1",
14-
"sass": "^1.54.5",
15-
"web-vitals": "^2.1.4"
16-
},
17-
"scripts": {
18-
"start": "react-scripts start",
19-
"build": "react-scripts build",
20-
"test": "react-scripts test",
21-
"eject": "react-scripts eject",
22-
"predeploy": "npm run build",
23-
"deploy": "gh-pages -d build"
24-
},
25-
"eslintConfig": {
26-
"extends": [
27-
"react-app",
28-
"react-app/jest"
29-
]
30-
},
31-
"browserslist": {
32-
"production": [
33-
">0.2%",
34-
"not dead",
35-
"not op_mini all"
36-
],
37-
"development": [
38-
"last 1 chrome version",
39-
"last 1 firefox version",
40-
"last 1 safari version"
41-
]
16+
"sass": "^1.77.1"
4217
},
4318
"devDependencies": {
44-
"gh-pages": "^4.0.0"
19+
"@types/react": "^18.2.66",
20+
"@types/react-dom": "^18.2.22",
21+
"@vitejs/plugin-react": "^4.2.1",
22+
"eslint": "^8.57.0",
23+
"eslint-plugin-react": "^7.34.1",
24+
"eslint-plugin-react-hooks": "^4.6.0",
25+
"eslint-plugin-react-refresh": "^0.4.6",
26+
"vite": "^5.2.0"
4527
}
4628
}

0 commit comments

Comments
 (0)