Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate vite for frontend tooling #741

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ cypress/videos
cypress/screenshots
.nyc_output

dist
# Ignore env local files - https://create-react-app.dev/docs/adding-custom-environment-variables/#what-other-env-files-can-be-used
.env*.local

Expand Down
41 changes: 41 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Web site created using create-react-app" />
<link rel="apple-touch-icon" href="/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.

Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</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>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.

You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.

To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
11 changes: 9 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"dinero.js": "1.8.1",
"formik": "2.2.6",
"history": "4.10.1",
"lodash": "4.17.21",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-google-login": "5.2.2",
Expand Down Expand Up @@ -79,6 +80,7 @@
"@types/validator": "13.1.3",
"@types/webpack-env": "1.16.0",
"@types/yup": "0.29.11",
"@vitejs/plugin-react-refresh": "1.3.1",
"aws-amplify": "3.0.23",
"aws-sdk": "2.874.0",
"bcryptjs": "2.4.3",
Expand Down Expand Up @@ -107,11 +109,14 @@
"nyc": "15.1.0",
"passport": "0.4.1",
"passport-local": "1.0.0",
"patch-package": "^6.2.2",
"postinstall-postinstall": "^2.1.0",
"prettier": "2.2.1",
"react-scripts": "4.0.2",
"start-server-and-test": "1.12.1",
"ts-node": "9.1.1",
"typescript": "4.2.3"
"typescript": "4.2.3",
"vite": "2.1.3"
},
"resolutions": {
"@babel/compat-data": "7.9.0",
Expand All @@ -120,6 +125,7 @@
},
"scripts": {
"dev": "cross-env NODE_ENV=development concurrently yarn:start:react yarn:start:api:watch",
"dev:vite": "NODE_ENV=development concurrently vite yarn:start:api:watch",
"dev:auth0": "cross-env REACT_APP_AUTH0=true NODE_ENV=development concurrently yarn:start:react yarn:start:api:watch",
"dev:okta": "cross-env REACT_APP_OKTA=true NODE_ENV=development concurrently yarn:start:react yarn:start:api:watch",
"dev:cognito": "cross-env REACT_APP_AWS_COGNITO=true NODE_ENV=development concurrently yarn:start:react yarn:start:api:watch",
Expand Down Expand Up @@ -164,10 +170,11 @@
"prebuild:ci": "yarn predev:cognito:ci",
"build:ci": "react-scripts build",
"build": "react-scripts build",
"build:vite": "vite build",
"eject": "react-scripts eject",
"codesandbox:start:api": "yarn tsnode:not-instrumented --files backend/app.ts",
"codesandbox:start": "NODE_ENV=development TSC_COMPILE_ON_ERROR=true concurrently \"react-scripts start\" yarn:start:api:codesandbox",
"postinstall": "husky install"
"postinstall": "patch-package && husky install"
},
"eslintConfig": {
"env": {
Expand Down
11 changes: 11 additions & 0 deletions patches/react-virtualized+9.22.3.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
diff --git a/node_modules/react-virtualized/dist/es/WindowScroller/utils/onScroll.js b/node_modules/react-virtualized/dist/es/WindowScroller/utils/onScroll.js
index d00f0f1..c8496e8 100644
--- a/node_modules/react-virtualized/dist/es/WindowScroller/utils/onScroll.js
+++ b/node_modules/react-virtualized/dist/es/WindowScroller/utils/onScroll.js
@@ -71,4 +71,3 @@ export function unregisterScrollListener(component, element) {
}
}
}
\ No newline at end of file
-import { bpfrpt_proptype_WindowScroller } from "../WindowScroller.js";
\ No newline at end of file
1 change: 1 addition & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/index.tsx"></script>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
Expand Down
20 changes: 20 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import reactRefresh from "@vitejs/plugin-react-refresh";
import { defineConfig } from "vite";

export default defineConfig({
optimizeDeps: {
entries: ["index.html"],
include: ["lodash/fp"],
exclude: ["./coverage", "./build"],
},
server: {
cors: { origin: "https://localhost:3000", credentials: true },
proxy: {
"/login": "http://localhost:3001/login",
"/callback": "http://localhost:3001/callback",
"/logout": "http://localhost:3001/logout",
"/checkAuth": "http://localhost:3001/checkAuth",
},
},
plugins: [reactRefresh()],
});
Loading