Skip to content

Commit

Permalink
vite migration wip
Browse files Browse the repository at this point in the history
  • Loading branch information
karlkeefer committed Jun 27, 2023
1 parent bca43b9 commit 76817df
Show file tree
Hide file tree
Showing 8 changed files with 7,518 additions and 1,808 deletions.
2 changes: 1 addition & 1 deletion nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ http {
proxy_set_header X-Forwarded-Host $server_name;
}

location /sockjs-node {
location /vite-development-wss {
proxy_pass http://react;
proxy_redirect off;
proxy_http_version 1.1;
Expand Down
9,249 changes: 7,465 additions & 1,784 deletions react/package-lock.json

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"react-dom": "^16.14.0",
"react-helmet": "^6.1.0",
"react-router-dom": "^6.8.1",
"react-scripts": "^5.0.1",
"sanitize.css": "^13.0.0",
"semantic-ui-react": "2.1.3",
"typescript": "^4.8.4"
Expand All @@ -21,10 +20,9 @@
}
},
"scripts": {
"start": "craco start",
"build": "craco build",
"test": "craco test",
"eject": "craco eject",
"start": "vite",
"build": "tsc && vite build",
"serve": "vite preview",
"lint": "eslint src"
},
"browserslist": [
Expand All @@ -47,6 +45,7 @@
"@types/react-helmet": "^6.1.5",
"@types/react-router": "^5.1.20",
"@types/react-router-dom": "^5.3.3",
"@vitejs/plugin-react": "^4.0.1",
"bufferutil": "^4.0.6",
"eslint-import-resolver-typescript": "^2.7.1",
"eslint-plugin-import": "^2.26.0",
Expand All @@ -56,6 +55,9 @@
"ts-node": "^10.9.1",
"type-fest": "^0.13.1",
"utf-8-validate": "^5.0.9",
"vite": "^4.3.9",
"vite-plugin-svgr": "^3.2.0",
"vite-tsconfig-paths": "^4.2.0",
"webpack-hot-middleware": "^2.25.2",
"webpack-plugin-serve": "^1.6.0"
}
Expand Down
17 changes: 0 additions & 17 deletions react/public/index.html

This file was deleted.

21 changes: 21 additions & 0 deletions react/src/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<link rel="manifest" href="/manifest.json">
<link rel="shortcut icon" href="/favicon.ico">
<title>PNGR</title>
</head>

<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
<script type="module" src="/src/index.tsx"></script>
</body>

</html>
1 change: 1 addition & 0 deletions react/src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
6 changes: 5 additions & 1 deletion react/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
"compilerOptions": {
"baseUrl": "./src",
"jsx": "react-jsx",
"target": "es5",
"target": "ESNext",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"types": [
"vite/client",
"vite-plugin-svgr/client"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
Expand Down
18 changes: 18 additions & 0 deletions react/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
import svgrPlugin from "vite-plugin-svgr";
import viteTsconfigPaths from "vite-tsconfig-paths";

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react(), viteTsconfigPaths(), svgrPlugin()],
server: {
host: true,
port: 3000,
hmr: {
host: 'localhost',
protocol: 'wss',
path: '/vite-development-wss'
}
},
});

0 comments on commit 76817df

Please sign in to comment.