Skip to content

Commit

Permalink
build(frontend): migrate from Create React App to Vite
Browse files Browse the repository at this point in the history
- add Vite packages and config.
- update build scripts.
- update ESLint config.
- update SVG shape imports.
- remove the old Express middleware proxy.
- clean up unused dependencies.
  • Loading branch information
eatyourgreens committed May 23, 2024
1 parent 0f0e031 commit b00ad3a
Show file tree
Hide file tree
Showing 15 changed files with 2,686 additions and 10,131 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@ terracotta.sqlite
__pycache__
*.egg-info
*.pyc

# frontend config
proxy-table.json
2 changes: 1 addition & 1 deletion frontend/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
extends: ['react-app', 'eslint:recommended'],
extends: ['react-app', 'eslint:recommended', 'eslint-config-prettier'],
rules: {
'react/prop-types': 'off',
'no-unused-vars': 'off',
Expand Down
14 changes: 14 additions & 0 deletions frontend/dev-proxy/proxy-table.cloud.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"/raster": {
"target": "https://jamaica.infrastructureresilience.org",
"changeOrigin": true
},
"/vector": {
"target": "https://jamaica.infrastructureresilience.org",
"changeOrigin": true
},
"/api": {
"target": "https://jamaica.infrastructureresilience.org",
"changeOrigin": true
}
}
23 changes: 23 additions & 0 deletions frontend/dev-proxy/proxy-table.dev.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"/raster": {
"target": "http://localhost:5000",
"changeOrigin": true,
"pathRewrite": {
"^/raster": "/"
}
},
"/vector": {
"target": "http://localhost:8080",
"changeOrigin": true,
"pathRewrite": {
"^/vector": "/"
}
},
"/api": {
"target": "http://localhost:8888",
"changeOrigin": true,
"pathRewrite": {
"^/api": "/"
}
}
}
1 change: 1 addition & 0 deletions frontend/public/index.html → frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
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.
Expand Down
Loading

0 comments on commit b00ad3a

Please sign in to comment.