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

chore(web): vite support dot path #1093

Merged
merged 2 commits into from
Apr 27, 2023
Merged
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
42 changes: 41 additions & 1 deletion web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@
"prettier-plugin-tailwindcss": "^0.2.6",
"tailwindcss": "^3.3.1",
"typescript": "5.0.3",
"vite": "^4.2.1"
"vite": "^4.2.1",
"vite-plugin-rewrite-all": "^1.0.1"
},
"lint-staged": {
"*.{ts,tsx}": [
Expand Down
4 changes: 2 additions & 2 deletions web/src/components/CommonIcon/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ export const DarkModeIcon = createIcon({

export const LangIcon = createIcon({
displayName: "LangIcon",
viewBox: "0 0 24 24",
viewBox: "0 0 20 20",
d: "M10 18.3333C5.39752 18.3333 1.66669 14.6025 1.66669 9.99996C1.66669 5.39746 5.39752 1.66663 10 1.66663C14.6025 1.66663 18.3334 5.39746 18.3334 9.99996C18.3334 14.6025 14.6025 18.3333 10 18.3333ZM8.09169 16.3891C7.26953 14.6452 6.79325 12.7585 6.68919 10.8333H3.38502C3.54718 12.1157 4.07829 13.3234 4.91383 14.3097C5.74937 15.296 6.85336 16.0184 8.09169 16.3891ZM8.35835 10.8333C8.48419 12.8658 9.06502 14.775 10 16.46C10.9603 14.7304 11.5212 12.8079 11.6417 10.8333H8.35835ZM16.615 10.8333H13.3109C13.2068 12.7585 12.7305 14.6452 11.9084 16.3891C13.1467 16.0184 14.2507 15.296 15.0862 14.3097C15.9218 13.3234 16.4529 12.1157 16.615 10.8333ZM3.38502 9.16663H6.68919C6.79325 7.24145 7.26953 5.3547 8.09169 3.61079C6.85336 3.98153 5.74937 4.70392 4.91383 5.69021C4.07829 6.67649 3.54718 7.88421 3.38502 9.16663ZM8.35919 9.16663H11.6409C11.5206 7.19212 10.96 5.26957 10 3.53996C9.03975 5.2695 8.47882 7.19206 8.35835 9.16663H8.35919ZM11.9084 3.61079C12.7305 5.3547 13.2068 7.24145 13.3109 9.16663H16.615C16.4529 7.88421 15.9218 6.67649 15.0862 5.69021C14.2507 4.70392 13.1467 3.98153 11.9084 3.61079Z",
});

export const GithubIcon = createIcon({
displayName: "GithubIcon",
viewBox: "0 0 24 24",
viewBox: "0 0 20 20",
d: "M9.99996 1.66663C5.39579 1.66663 1.66663 5.39579 1.66663 9.99996C1.66568 11.7494 2.21564 13.4546 3.23847 14.8739C4.26131 16.2931 5.70508 17.3542 7.36496 17.9066C7.78163 17.9791 7.93746 17.7291 7.93746 17.51C7.93746 17.3125 7.92663 16.6566 7.92663 15.9583C5.83329 16.3441 5.29163 15.4483 5.12496 14.9791C5.03079 14.7391 4.62496 14 4.27079 13.8016C3.97913 13.6458 3.56246 13.26 4.25996 13.25C4.91663 13.2391 5.38496 13.8541 5.54163 14.1041C6.29163 15.3641 7.48996 15.01 7.96829 14.7916C8.04163 14.25 8.25996 13.8858 8.49996 13.6775C6.64579 13.4691 4.70829 12.75 4.70829 9.56246C4.70829 8.65579 5.03079 7.90663 5.56246 7.32246C5.47913 7.11413 5.18746 6.25996 5.64579 5.11413C5.64579 5.11413 6.34329 4.89579 7.93746 5.96913C8.61585 5.78084 9.31677 5.68608 10.0208 5.68746C10.7291 5.68746 11.4375 5.78079 12.1041 5.96829C13.6975 4.88496 14.3958 5.11496 14.3958 5.11496C14.8541 6.26079 14.5625 7.11496 14.4791 7.32329C15.01 7.90663 15.3333 8.64579 15.3333 9.56246C15.3333 12.7608 13.3858 13.4691 11.5316 13.6775C11.8333 13.9375 12.0941 14.4375 12.0941 15.2191C12.0941 16.3333 12.0833 17.2291 12.0833 17.5108C12.0833 17.7291 12.24 17.9891 12.6566 17.9058C14.3108 17.3473 15.7482 16.2841 16.7665 14.8659C17.7849 13.4477 18.3328 11.7459 18.3333 9.99996C18.3333 5.39579 14.6041 1.66663 9.99996 1.66663Z",
});

Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/homepage/language.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const Language = (props: Props) => {
src={darkMode ? "/homepage/dark/language.svg" : "/homepage/language.svg"}
alt="language"
/> */}
<LangIcon color={darkMode ? "#F6F8F9" : "#3C455D"} fontSize={32} />
<LangIcon className="mr-1" color={darkMode ? "#F6F8F9" : "#3C455D"} fontSize={24} />
<p>{i18n.language === "en" ? "中文" : "English"}</p>
</a>
</div>
Expand Down
6 changes: 5 additions & 1 deletion web/src/pages/homepage/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,11 @@ const Navbar = (props: Props) => {
className="flex"
rel="noreferrer"
>
<GithubIcon fontSize={32} color={darkMode ? "#F6F8F9" : "#3C455D"} />
<GithubIcon
className="mr-1"
fontSize={24}
color={darkMode ? "#F6F8F9" : "#3C455D"}
/>
{stars}
</a>
) : null}
Expand Down
3 changes: 2 additions & 1 deletion web/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import react from "@vitejs/plugin-react-swc";
import path from "path";
import { defineConfig, loadEnv } from "vite";
import pluginRewriteAll from "vite-plugin-rewrite-all";

// https://vitejs.dev/config/
export default defineConfig(({ command, mode }) => {
Expand All @@ -16,7 +17,7 @@ export default defineConfig(({ command, mode }) => {
},
},
},
plugins: [react()],
plugins: [react(), pluginRewriteAll()],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
Expand Down