Skip to content

Commit

Permalink
refactor(cleanup): remove react as not used
Browse files Browse the repository at this point in the history
  • Loading branch information
domi7777 committed Dec 20, 2024
1 parent 9fb09ee commit 4b0dcf6
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 200 deletions.
5 changes: 1 addition & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,9 @@
</style>
</head>
<body style="padding: 0;margin: 0">
<div id="root" style>
<img src="./icons/pwa-512x512.png" alt="loading" style="width:100%;height:100%"/>
</div>
<div id="settings"></div>
<div id="phaser-container"></div>
<script type="module" src="/src/main.tsx"></script>
<script type="module" src="/src/main.ts"></script>
<!-- TODO move in settings menu-->
<!-- <p style="text-align:center;padding:10px">-->
<!-- <a href="https://github.com/domi7777/larsen">-->
Expand Down
177 changes: 10 additions & 167 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,13 @@
"dependencies": {
"@tweakpane/plugin-essentials": "^0.2.1",
"phaser": "^3.85.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"tweakpane": "^4.0.4"
},
"devDependencies": {
"@tweakpane/core": "^2.0.4",
"@types/react": "^18.2.43",
"@types/react-dom": "^18.2.17",
"@typescript-eslint/eslint-plugin": "^6.14.0",
"@typescript-eslint/parser": "^6.14.0",
"@vitejs/plugin-react": "^4.2.1",
"eslint": "^8.55.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.5",
"typescript": "^5.2.2",
"vite": "^5.0.8",
"vite-plugin-pwa": "^0.20.0"
Expand Down
7 changes: 0 additions & 7 deletions src/App.tsx

This file was deleted.

3 changes: 1 addition & 2 deletions src/Game.tsx → src/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function resizeGame(game: Phaser.Game) {

let isGameInitialized = false;

export const Game = () => {
export const createGame = () => {
if (!isGameInitialized) {
isGameInitialized = true;
loadFonts().then(() => {
Expand Down Expand Up @@ -43,5 +43,4 @@ export const Game = () => {
resizeGame(game);
});
}
return <></>;
}
5 changes: 5 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import {createGame} from './game.ts';

(()=> {
createGame();
})();
9 changes: 0 additions & 9 deletions src/main.tsx

This file was deleted.

1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",

/* Linting */
"strict": true,
Expand Down
3 changes: 0 additions & 3 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import {defineConfig} from 'vite'
import react from '@vitejs/plugin-react'
import {VitePWA} from 'vite-plugin-pwa'

// https://vitejs.dev/config/
export default defineConfig({
base: '',
plugins: [
react(),
VitePWA({
registerType: 'autoUpdate',
manifest: {
Expand Down Expand Up @@ -54,7 +52,6 @@ export default defineConfig({
rollupOptions: {
output: {
manualChunks: {
react: ['react', 'react-dom'],
phaser: ['phaser'],
}
}
Expand Down

0 comments on commit 4b0dcf6

Please sign in to comment.