Skip to content

Commit

Permalink
fix: get assets with using another paths in url
Browse files Browse the repository at this point in the history
  • Loading branch information
Proza1k committed Aug 20, 2024
1 parent 6dc407e commit 1f71da4
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 14 deletions.
1 change: 1 addition & 0 deletions application/frontend/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_BASE_URL='https://example.com/path'
1 change: 1 addition & 0 deletions application/frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
dist
node_modules
.env
3 changes: 0 additions & 3 deletions application/frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
<script>
document.write('<base href="' + window.location.pathname + '" />');
</script>
</head>
<body>
<div id="root"></div>
Expand Down
16 changes: 16 additions & 0 deletions application/frontend/package-lock.json

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

5 changes: 3 additions & 2 deletions application/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@
"vite-tsconfig-paths": "^5.0.1"
},
"devDependencies": {
"@eslint/js": "^9.8.0",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@vitejs/plugin-react": "^4.3.1",
"@eslint/js": "^9.8.0",
"@types/node": "^22.4.1",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.1",
"@vitejs/plugin-react-swc": "^3.5.0",
"eslint": "^9.8.0",
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
Expand Down
4 changes: 2 additions & 2 deletions application/frontend/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import tsconfigPaths from "vite-tsconfig-paths"

import react from "@vitejs/plugin-react-swc"

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react(), tsconfigPaths()],
})
base: process.env.VITE_BASE_URL || '/'
});
File renamed without changes.
1 change: 1 addition & 0 deletions demo/assets/index-ChFl1CfJ.css

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion demo/assets/index-Cs25ijQy.css

This file was deleted.

9 changes: 3 additions & 6 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<link rel="icon" type="image/svg+xml" href="https://digitable-lol.github.io/light-traffic/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
<script>
document.write('<base href="' + window.location.pathname + '" />');
</script>
<script type="module" crossorigin src="/assets/index-DZdjjMwg.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-Cs25ijQy.css">
<script type="module" crossorigin src="https://digitable-lol.github.io/light-traffic/assets/index-Bc41vKJH.js"></script>
<link rel="stylesheet" crossorigin href="https://digitable-lol.github.io/light-traffic/assets/index-ChFl1CfJ.css">
</head>
<body>
<div id="root"></div>
Expand Down

0 comments on commit 1f71da4

Please sign in to comment.