Skip to content

Commit 8f99014

Browse files
committed
refactor: migrate vite v2
1 parent b214eb3 commit 8f99014

File tree

8 files changed

+41
-99
lines changed

8 files changed

+41
-99
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
"devDependencies": {
1616
"@types/react": "^17.0.0",
1717
"@types/react-dom": "^17.0.0",
18+
"@vitejs/plugin-react-refresh": "^1.3.2",
1819
"typescript": "^4.1.2",
19-
"vite": "2.1.5",
20-
"vite-plugin-react": "^4.0.0"
20+
"vite": "2.1.5"
2121
}
2222
}

src/App.css

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

src/App.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React from "react";
22
import { QueryClient, QueryClientProvider } from "react-query";
33
import AnimeQuotes from "./AnimeQuotes";
4-
import "./App.css";
54

65
const queryClient = new QueryClient();
76

src/index.css

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

src/logo.svg

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

src/main.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import React from 'react'
2-
import ReactDOM from 'react-dom'
3-
import './index.css'
4-
import App from './App'
1+
import React from "react";
2+
import ReactDOM from "react-dom";
3+
import App from "./App";
54

65
ReactDOM.render(
76
<React.StrictMode>
87
<App />
98
</React.StrictMode>,
10-
document.getElementById('root')
11-
)
9+
document.getElementById("root")
10+
);

vite.config.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
import * as reactPlugin from 'vite-plugin-react'
2-
import type { UserConfig } from 'vite'
1+
import { defineConfig } from "vite";
2+
import reactRefresh from "@vitejs/plugin-react-refresh";
33

4-
const config: UserConfig = {
5-
jsx: 'react',
6-
plugins: [reactPlugin]
7-
}
8-
9-
export default config
4+
// https://vitejs.dev/config/
5+
export default defineConfig({
6+
plugins: [reactRefresh()],
7+
});

yarn.lock

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.13.15.tgz#7e8eea42d0b64fda2b375b22d06c605222e848f4"
1515
integrity sha512-ltnibHKR1VnrU4ymHyQ/CXtNXI6yZC0oJThyW78Hft8XndANwi+9H+UIklBDraIjFEJzw8wmcM427oDd9KS5wA==
1616

17-
"@babel/core@^7.9.6":
17+
"@babel/core@^7.12.13":
1818
version "7.13.15"
1919
resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.13.15.tgz#a6d40917df027487b54312202a06812c4f7792d0"
2020
integrity sha512-6GXmNYeNjS2Uz+uls5jalOemgIhnTMeaXo+yBUA72kC2uX/8VW6XyhVIo2L8/q0goKQA3EVKx0KOQpVKSeWadQ==
@@ -105,7 +105,7 @@
105105
dependencies:
106106
"@babel/types" "^7.12.13"
107107

108-
"@babel/helper-plugin-utils@^7.10.4":
108+
"@babel/helper-plugin-utils@^7.12.13":
109109
version "7.13.0"
110110
resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz#806526ce125aed03373bc416a828321e3a6a33af"
111111
integrity sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==
@@ -167,12 +167,19 @@
167167
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.13.15.tgz#8e66775fb523599acb6a289e12929fa5ab0954d8"
168168
integrity sha512-b9COtcAlVEQljy/9fbcMHpG+UIW9ReF+gpaxDHTlZd0c6/UU9ng8zdySAW9sRTzpvcdCHn6bUcbuYUgGzLAWVQ==
169169

170-
"@babel/plugin-syntax-import-meta@^7.10.4":
171-
version "7.10.4"
172-
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz#ee601348c370fa334d2207be158777496521fd51"
173-
integrity sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==
170+
"@babel/plugin-transform-react-jsx-self@^7.12.13":
171+
version "7.12.13"
172+
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.12.13.tgz#422d99d122d592acab9c35ea22a6cfd9bf189f60"
173+
integrity sha512-FXYw98TTJ125GVCCkFLZXlZ1qGcsYqNQhVBQcZjyrwf8FEUtVfKIoidnO8S0q+KBQpDYNTmiGo1gn67Vti04lQ==
174+
dependencies:
175+
"@babel/helper-plugin-utils" "^7.12.13"
176+
177+
"@babel/plugin-transform-react-jsx-source@^7.12.13":
178+
version "7.12.13"
179+
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.12.13.tgz#051d76126bee5c9a6aa3ba37be2f6c1698856bcb"
180+
integrity sha512-O5JJi6fyfih0WfDgIJXksSPhGP/G0fQpfxYy87sDc+1sFmsCS6wr3aAn+whbzkhbjtq4VMqLRaSzR6IsshIC0Q==
174181
dependencies:
175-
"@babel/helper-plugin-utils" "^7.10.4"
182+
"@babel/helper-plugin-utils" "^7.12.13"
176183

177184
"@babel/runtime@^7.12.5", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.2", "@babel/runtime@^7.7.2":
178185
version "7.13.10"
@@ -239,6 +246,16 @@
239246
resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.1.tgz#18845205e86ff0038517aab7a18a62a6b9f71275"
240247
integrity sha512-EaCxbanVeyxDRTQBkdLb3Bvl/HK7PBK6UJjsSixB0iHKoWxE5uu2Q/DgtpOhPIojN0Zl1whvOd7PoHs2P0s5eA==
241248

249+
"@vitejs/plugin-react-refresh@^1.3.2":
250+
version "1.3.2"
251+
resolved "https://registry.yarnpkg.com/@vitejs/plugin-react-refresh/-/plugin-react-refresh-1.3.2.tgz#c807c9c77694943b8e51f0a80babba6b078a3218"
252+
integrity sha512-ujHk6wqY9MZh8PkjeQeeDHfds4teTD4mkG34++gVoQJgATO/Hpq7rcEYbFZ5Dyup3zlpe2jyu0gFuqznLnBUyQ==
253+
dependencies:
254+
"@babel/core" "^7.12.13"
255+
"@babel/plugin-transform-react-jsx-self" "^7.12.13"
256+
"@babel/plugin-transform-react-jsx-source" "^7.12.13"
257+
react-refresh "^0.9.0"
258+
242259
ansi-styles@^3.2.1:
243260
version "3.2.1"
244261
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
@@ -585,10 +602,10 @@ react-query@^3.13.10:
585602
broadcast-channel "^3.4.1"
586603
match-sorter "^6.0.2"
587604

588-
react-refresh@^0.8.2:
589-
version "0.8.3"
590-
resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.8.3.tgz#721d4657672d400c5e3c75d063c4a85fb2d5d68f"
591-
integrity sha512-X8jZHc7nCMjaCqoU+V2I0cOhNW+QMBwSUkeXnTi8IPe6zaRWfn60ZzvFDZqWPfmSJfjub7dDW1SP0jaHWLu/hg==
605+
react-refresh@^0.9.0:
606+
version "0.9.0"
607+
resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.9.0.tgz#71863337adc3e5c2f8a6bfddd12ae3bfe32aafbf"
608+
integrity sha512-Gvzk7OZpiqKSkxsQvO/mbTN1poglhmAV7gR/DdIrRrSMXraRQQlfikRJOr3Nb9GTMPC5kof948Zy6jJZIFtDvQ==
592609

593610
react@^17.0.0:
594611
version "17.0.2"
@@ -688,15 +705,6 @@ unload@2.2.0:
688705
"@babel/runtime" "^7.6.2"
689706
detect-node "^2.0.4"
690707

691-
vite-plugin-react@^4.0.0:
692-
version "4.0.1"
693-
resolved "https://registry.yarnpkg.com/vite-plugin-react/-/vite-plugin-react-4.0.1.tgz#5dd04f20ec4ebd17ca52f53a3faac51255ebb0d8"
694-
integrity sha512-liDo/wxTcy2E5cptwsAUZIC0F4flxWkmcPOJdhKCzJIC9XguWCCJimzziTQRmHuqIPawmQNE8PJb8+RlGzNxOA==
695-
dependencies:
696-
"@babel/core" "^7.9.6"
697-
"@babel/plugin-syntax-import-meta" "^7.10.4"
698-
react-refresh "^0.8.2"
699-
700708
vite@2.1.5:
701709
version "2.1.5"
702710
resolved "https://registry.yarnpkg.com/vite/-/vite-2.1.5.tgz#4857da441c62f7982c83cbd5f42a00330f20c9c1"

0 commit comments

Comments
 (0)