-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Vite): migrate example app to vite
- Loading branch information
1 parent
70e637d
commit d2e65be
Showing
16 changed files
with
15,481 additions
and
23,117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
REACT_APP_AWS_ACCESS_KEY_ID= | ||
REACT_APP_AWS_SECRET_ACCESS_KEY= | ||
REACT_APP_AWS_SESSION_TOKEN= | ||
VITE_AWS_ACCESS_KEY_ID= | ||
VITE_AWS_SECRET_ACCESS_KEY= | ||
VITE_AWS_SESSION_TOKEN= |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<!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" | ||
/> | ||
<title>IoT AppKit Sample Application</title> | ||
</head> | ||
<body> | ||
<noscript>You need to enable JavaScript to run this app.</noscript> | ||
<div id="root"></div> | ||
<!-- | ||
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> | ||
<script type="module" src="/src/index.tsx"></script> | ||
</html> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
export const getEnvCredentials = () => { | ||
if ( | ||
process.env.REACT_APP_AWS_ACCESS_KEY_ID == null || | ||
process.env.REACT_APP_AWS_SECRET_ACCESS_KEY == null | ||
import.meta.env.VITE_AWS_ACCESS_KEY_ID == null || | ||
import.meta.env.VITE_AWS_SECRET_ACCESS_KEY == null | ||
) { | ||
throw new Error( | ||
'Missing credentials: must provide the following env variables: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY within .env.local' | ||
'Missing credentials: must provide the following env variables: VITE_AWS_ACCESS_KEY_ID, VITE_AWS_SECRET_ACCESS_KEY within .env.local' | ||
); | ||
} | ||
return { | ||
// Provided by `.env.local` environment variable file | ||
accessKeyId: process.env.REACT_APP_AWS_ACCESS_KEY_ID, | ||
secretAccessKey: process.env.REACT_APP_AWS_SECRET_ACCESS_KEY, | ||
sessionToken: process.env.REACT_APP_AWS_SESSION_TOKEN, | ||
accessKeyId: import.meta.env.VITE_AWS_ACCESS_KEY_ID, | ||
secretAccessKey: import.meta.env.VITE_AWS_SECRET_ACCESS_KEY, | ||
sessionToken: import.meta.env.VITE_AWS_SESSION_TOKEN, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
window.global ||= window; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { defineConfig } from 'vite'; | ||
import react from '@vitejs/plugin-react'; | ||
|
||
export default defineConfig(() => { | ||
return { | ||
build: { | ||
outDir: 'build', | ||
}, | ||
assetsInclude: ['**/*.hdr'], | ||
plugins: [react()], | ||
server: { | ||
port: 3000, | ||
host: true, | ||
}, | ||
resolve: { | ||
alias: { | ||
path: 'rollup-plugin-node-polyfills/polyfills/path', | ||
}, | ||
}, | ||
preview: { | ||
port: 4000, | ||
}, | ||
}; | ||
}); |
Oops, something went wrong.