Skip to content

Commit ec458b6

Browse files
authored
Merge pull request #55 from raduwen/fix/urls
fix urls
2 parents 6341bb9 + f4da057 commit ec458b6

File tree

9 files changed

+80
-9
lines changed

9 files changed

+80
-9
lines changed

admin/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
</head>
99
<body>
1010
<div id="root"></div>
11-
<script type="module" src="/src/pages/admin/main.tsx"></script>
11+
<script type="module" src="/admin/main.tsx"></script>
1212
</body>
1313
</html>
File renamed without changes.

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
</head>
99
<body>
1010
<div id="root"></div>
11-
<script type="module" src="/src/pages/preview/main.tsx"></script>
11+
<script type="module" src="/main.tsx"></script>
1212
</body>
1313
</html>

main.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import React from 'react';
2+
import { render } from 'react-dom';
3+
4+
import '@/global.css';
5+
6+
render(
7+
<React.StrictMode>
8+
<div>NO Content</div>
9+
</React.StrictMode>,
10+
document.getElementById('root')
11+
);

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"firebase-tools": "^9.16.5",
3131
"typescript": "^4.3.2",
3232
"vite": "^2.5.0",
33+
"vite-plugin-mpa": "^1.0.3",
3334
"vite-tsconfig-paths": "^3.3.13"
3435
},
3536
"resolutions": {

preview/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/src/favicon.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>raduwen-obs-widget</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/preview/main.tsx"></script>
12+
</body>
13+
</html>
File renamed without changes.

vite.config.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,28 @@
11
import { defineConfig } from 'vite';
22
import reactRefresh from '@vitejs/plugin-react-refresh';
33
import tsconfigPaths from 'vite-tsconfig-paths';
4-
import { resolve } from 'path';
4+
import mpa from 'vite-plugin-mpa';
5+
6+
var plugins = [tsconfigPaths()];
7+
8+
if (process.env.NODE_ENV !== "production") {
9+
plugins.push(reactRefresh());
10+
plugins.push(mpa({
11+
scanDir: '.'
12+
})
13+
);
14+
}
515

616
// https://vitejs.dev/config/
717
export default defineConfig({
818
build: {
919
rollupOptions: {
1020
input: {
11-
main: resolve(__dirname, 'index.html'),
12-
admin: resolve(__dirname, 'admin/index.html'),
21+
main: 'index.html',
22+
preview: 'preview/index.html',
23+
admin: 'admin/index.html'
1324
}
1425
}
1526
},
16-
plugins: [tsconfigPaths(), reactRefresh()]
27+
plugins,
1728
});

yarn.lock

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1708,6 +1708,11 @@ configstore@^5.0.1:
17081708
write-file-atomic "^3.0.0"
17091709
xdg-basedir "^4.0.0"
17101710

1711+
connect-history-api-fallback@1.6.0:
1712+
version "1.6.0"
1713+
resolved "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz#8b32089359308d111115d81cad3fceab888f97bc"
1714+
integrity sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg==
1715+
17111716
connect@^3.6.2:
17121717
version "3.7.0"
17131718
resolved "https://registry.yarnpkg.com/connect/-/connect-3.7.0.tgz#5d49348910caa5e07a01800b030d0c35f20484f8"
@@ -2690,7 +2695,7 @@ glob-slasher@^1.0.1:
26902695
lodash.isobject "^2.4.1"
26912696
toxic "^1.0.0"
26922697

2693-
glob@^7.1.2, glob@^7.1.3, glob@^7.1.4:
2698+
glob@^7.0.0, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4:
26942699
version "7.1.7"
26952700
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90"
26962701
integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==
@@ -3057,6 +3062,11 @@ install-artifact-from-github@^1.2.0:
30573062
resolved "https://registry.yarnpkg.com/install-artifact-from-github/-/install-artifact-from-github-1.2.0.tgz#adcbd123c16a4337ec44ea76d0ebf253cc16b074"
30583063
integrity sha512-3OxCPcY55XlVM3kkfIpeCgmoSKnMsz2A3Dbhsq0RXpIknKQmrX1YiznCeW9cD2ItFmDxziA3w6Eg8d80AoL3oA==
30593064

3065+
interpret@^1.0.0:
3066+
version "1.4.0"
3067+
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e"
3068+
integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==
3069+
30603070
ip-regex@^4.1.0:
30613071
version "4.3.0"
30623072
resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-4.3.0.tgz#687275ab0f57fa76978ff8f4dddc8a23d5990db5"
@@ -4585,6 +4595,13 @@ readdirp@~3.5.0:
45854595
dependencies:
45864596
picomatch "^2.2.1"
45874597

4598+
rechoir@^0.6.2:
4599+
version "0.6.2"
4600+
resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384"
4601+
integrity sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=
4602+
dependencies:
4603+
resolve "^1.1.6"
4604+
45884605
recrawl-sync@^2.0.3:
45894606
version "2.2.1"
45904607
resolved "https://registry.yarnpkg.com/recrawl-sync/-/recrawl-sync-2.2.1.tgz#cb02c8084c22b3cea103abf46bb88734076ed6bb"
@@ -4657,7 +4674,7 @@ require-directory@^2.1.1:
46574674
resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
46584675
integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I=
46594676

4660-
resolve@^1.20.0:
4677+
resolve@^1.1.6, resolve@^1.20.0:
46614678
version "1.20.0"
46624679
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975"
46634680
integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==
@@ -4868,6 +4885,15 @@ shebang-regex@^3.0.0:
48684885
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172"
48694886
integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==
48704887

4888+
shelljs@0.8.4:
4889+
version "0.8.4"
4890+
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.4.tgz#de7684feeb767f8716b326078a8a00875890e3c2"
4891+
integrity sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==
4892+
dependencies:
4893+
glob "^7.0.0"
4894+
interpret "^1.0.0"
4895+
rechoir "^0.6.2"
4896+
48714897
side-channel@^1.0.4:
48724898
version "1.0.4"
48734899
resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf"
@@ -5520,6 +5546,15 @@ verror@1.10.0:
55205546
core-util-is "1.0.2"
55215547
extsprintf "^1.2.0"
55225548

5549+
vite-plugin-mpa@^1.0.3:
5550+
version "1.0.3"
5551+
resolved "https://registry.yarnpkg.com/vite-plugin-mpa/-/vite-plugin-mpa-1.0.3.tgz#1c6ee5a8e8f5ace32e60827433fc73b56d705724"
5552+
integrity sha512-qNA0koRvn+iR1KUUjbWS1GRPXqhPCx17hdkpJ3VxdbjjnZcmhtMce/oN/6ww9g7fSN4McdNUO5r8Hsy9axu8kA==
5553+
dependencies:
5554+
connect-history-api-fallback "1.6.0"
5555+
shelljs "0.8.4"
5556+
yargs "16.2.0"
5557+
55235558
vite-tsconfig-paths@^3.3.13:
55245559
version "3.3.13"
55255560
resolved "https://registry.yarnpkg.com/vite-tsconfig-paths/-/vite-tsconfig-paths-3.3.13.tgz#a9e60aa3759799f3035581de8e4bb00215f039f6"
@@ -5698,7 +5733,7 @@ yargs-parser@^20.2.2:
56985733
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.7.tgz#61df85c113edfb5a7a4e36eb8aa60ef423cbc90a"
56995734
integrity sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw==
57005735

5701-
yargs@^16.1.1:
5736+
yargs@16.2.0, yargs@^16.1.1:
57025737
version "16.2.0"
57035738
resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66"
57045739
integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==

0 commit comments

Comments
 (0)