-
Notifications
You must be signed in to change notification settings - Fork 5
[UI] Vite Migration #38
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -2,14 +2,14 @@ | |||||||
| <html lang="en"> | ||||||||
| <head> | ||||||||
| <meta charset="utf-8" /> | ||||||||
| <link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> | ||||||||
| <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="A self-service portal for accessing Power Hardware resources, enabling seamless development, testing, and optimization on Power Architecture." | ||||||||
| /> | ||||||||
| <script src="%PUBLIC_URL%/env-config.js"></script> | ||||||||
| <script src="/env-config.js"></script> | ||||||||
| <script | ||||||||
| src="https://cdn.jsdelivr.net/npm/react/umd/react.production.min.js" | ||||||||
| crossorigin | ||||||||
|
|
@@ -28,25 +28,16 @@ | |||||||
| <script> | ||||||||
| var Alert = ReactBootstrap.Alert; | ||||||||
| </script> | ||||||||
| <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" /> | ||||||||
| <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="%PUBLIC_URL%/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`. | ||||||||
| --> | ||||||||
| <link rel="manifest" href="/manifest.json" /> | ||||||||
| <title>IBM® Power® Access Cloud</title> | ||||||||
| </head> | ||||||||
| <body> | ||||||||
| <noscript>You need to enable JavaScript to run this app.</noscript> | ||||||||
| <script type="module" src="/src/index.jsx"></script> | ||||||||
| <div id="root"></div> | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can the script tag be moved after the root div , for better loading.
Suggested change
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure will be doing it. Thanks |
||||||||
| <!-- | ||||||||
| This HTML file is a template. | ||||||||
|
|
||||||||
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| import { defineConfig } from "vite"; | ||
| import react from "@vitejs/plugin-react"; | ||
|
|
||
| export default defineConfig({ | ||
| plugins: [react()], | ||
| build: { | ||
| outDir: "build", | ||
| }, | ||
| server: { | ||
| port: 3000, | ||
| proxy: { | ||
| "/pac-go-server": { | ||
| target: "http://localhost:8000", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here, we are hardcoding the target to localhost:8000, but I believe we were also using a env variable (REACT_APP_PAC_GO_SERVER_TARGET ) earlier in setupProxy.js to point to a dev server.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can do that. I will be creating a Vite env variable as we require it only for dev and add it here. |
||
| changeOrigin: true, | ||
| rewrite: (path) => path.replace(/^\/pac-go-server/, '/api/v1'), | ||
| } | ||
| }, | ||
| }, | ||
| }); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do these external scripts do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah good question. We need only env-config.js for loading the env's
Rest seems like it already existed, so I have kept it.
Maybe we can do the cleanup seperately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, we can do that.