Spaces:
Running
Running
Commit
·
eec97a2
1
Parent(s):
d243f83
Deploy build
Browse files- deploy.sh +20 -0
- index.html +8 -8
- vite.config.js +7 -7
deploy.sh
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/bash
|
2 |
+
# Build the project
|
3 |
+
npm run build
|
4 |
+
|
5 |
+
# Ensure the dist directory exists
|
6 |
+
if [ -d "dist" ]; then
|
7 |
+
# Copy all files from dist to the root, but not overwrite the src and public directories
|
8 |
+
cp -r dist/* .
|
9 |
+
|
10 |
+
# Optionally, clean up the dist directory after copying
|
11 |
+
rm -rf dist
|
12 |
+
else
|
13 |
+
echo "Build directory 'dist' does not exist. Please run 'npm run build' first."
|
14 |
+
exit 1
|
15 |
+
fi
|
16 |
+
|
17 |
+
# Add, commit, and push changes to the repository
|
18 |
+
git add .
|
19 |
+
git commit -m "Deploy build"
|
20 |
+
git push origin main --force
|
index.html
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
<!DOCTYPE html>
|
2 |
<html lang="en">
|
3 |
<head>
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
<script type="module" crossorigin src="/assets/index-DLuDOp88.js"></script>
|
9 |
-
<link rel="stylesheet" crossorigin href="/assets/index-Br12QZr0.css">
|
10 |
-
|
11 |
<body>
|
12 |
-
|
13 |
</body>
|
14 |
</html>
|
|
|
1 |
<!DOCTYPE html>
|
2 |
<html lang="en">
|
3 |
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<link rel="icon" type="image/svg+xml" href="/vite.svg">
|
6 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
7 |
+
<title>Vite + React</title>
|
8 |
+
<script type="module" crossorigin src="/assets/index-DLuDOp88.js"></script>
|
9 |
+
<link rel="stylesheet" crossorigin href="/assets/index-Br12QZr0.css">
|
10 |
+
</head>
|
11 |
<body>
|
12 |
+
<div id="root"></div>
|
13 |
</body>
|
14 |
</html>
|
vite.config.js
CHANGED
@@ -3,12 +3,12 @@ import react from '@vitejs/plugin-react';
|
|
3 |
|
4 |
export default defineConfig({
|
5 |
plugins: [react()],
|
|
|
|
|
|
|
|
|
6 |
build: {
|
7 |
-
outDir: 'dist'
|
8 |
-
rollupOptions: {
|
9 |
-
output: {
|
10 |
-
manualChunks: undefined,
|
11 |
-
},
|
12 |
-
},
|
13 |
},
|
14 |
-
|
|
|
|
3 |
|
4 |
export default defineConfig({
|
5 |
plugins: [react()],
|
6 |
+
server: {
|
7 |
+
port: 5000,
|
8 |
+
open: true,
|
9 |
+
},
|
10 |
build: {
|
11 |
+
outDir: 'dist'
|
|
|
|
|
|
|
|
|
|
|
12 |
},
|
13 |
+
publicDir: 'public',
|
14 |
+
});
|