From e04eff53460af8e15d258dccec13c3550d35f96d Mon Sep 17 00:00:00 2001 From: Rajas Paranjpe <52586855+ChocolateLoverRaj@users.noreply.github.com> Date: Sat, 27 Aug 2022 12:47:38 -0700 Subject: [PATCH] More progress to switching to vite --- .vscode/settings.json | 2 +- package.json | 7 +++---- src/AllGames.tsx | 14 ++++++++------ src/Game.tsx | 13 ++++++++----- src/dark.lazy.css | 1 - src/games.ts | 8 +------- src/index.html | 3 ++- src/light.lazy.css | 1 - src/main.tsx | 16 ++++++++-------- src/types.d.ts | 2 ++ src/util/indexedDb/index.ts | 2 ++ src/vite.config.js | 20 ++++++++++++++++++++ tsconfig.json | 5 +++-- 13 files changed, 58 insertions(+), 36 deletions(-) delete mode 100644 src/dark.lazy.css delete mode 100644 src/light.lazy.css create mode 100644 src/util/indexedDb/index.ts create mode 100644 src/vite.config.js diff --git a/.vscode/settings.json b/.vscode/settings.json index 4f70e30..e5cae0e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -12,6 +12,6 @@ "**/.project": true, "**/.settings": true, "**/.factorypath": true, - "**/node_modules": true + "**/node_modules": false } } diff --git a/package.json b/package.json index d989bfb..feb87a4 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ }, "scripts": { "lint": "eslint .", - "start": "webpack serve", + "start": "vite src --host", "build:index-js": "create-index-js -i \"\" src -c dirs.txt --filesConfig files.txt", "build:logo": "node -r ts-node/register src/buildLogo", "build:webpack": "webpack --progress", @@ -41,7 +41,6 @@ "map-values": "^1.0.1", "matter-js": "^0.17.1", "mobx": "^6.3.7", - "mobx-autorun-cleanup": "^1.2.0", "mobx-observable-promise": "^0.5.16", "mobx-react-lite": "^3.2.2", "mobx-theme": "^3.0.0", @@ -97,11 +96,11 @@ "@types/webpack-env": "^1.16.2", "@types/webpack-stats-plugin": "^0.3.2", "@typescript-eslint/eslint-plugin": ">=4.0.1", + "@vitejs/plugin-react": "^2.0.1", "babel-loader": "^8.2.2", "babel-plugin-import": "^1.13.3", "babel-plugin-react-require": "^3.1.3", "cspell": "^6.7.0", - "css-loader": "^5.2.6", "css-minimizer-webpack-plugin": "^3.3.1", "eslint": ">=7.12.1", "eslint-config-standard-jsx": "^10.0.0", @@ -116,11 +115,11 @@ "rc-field-form": "^1.21.1", "react-refresh": "^0.11.0", "react-use-promise": "^0.3.1", - "style-loader": "^3.3.1", "terser-webpack-plugin": "^5.3.0", "ts-node": "^10.1.0", "typescript": "^4.3.5", "typescript-plugin-css-modules": "^3.4.0", + "vite": "^3.0.9", "webpack": "^5.44.0", "webpack-bundle-analyzer": "^4.4.2", "webpack-cli": "^4.7.2", diff --git a/src/AllGames.tsx b/src/AllGames.tsx index cfe1cb7..f53f391 100644 --- a/src/AllGames.tsx +++ b/src/AllGames.tsx @@ -20,7 +20,7 @@ import { css } from '@emotion/css' import { red } from '@ant-design/colors' import centerStyles from './centerStyles' -const allTags = new Set([...games.values()].flatMap(({ tags }) => tags ?? [])) +const allTags = new Set(Object.values(games).flatMap(({ tags }) => tags ?? [])) const AllGames: FC = () => { const [ @@ -43,8 +43,9 @@ const AllGames: FC = () => {