diff --git a/admin/index.html b/admin/index.html index 198af256..ca5ddf2f 100644 --- a/admin/index.html +++ b/admin/index.html @@ -8,6 +8,6 @@
- + diff --git a/src/pages/admin/main.tsx b/admin/main.tsx similarity index 100% rename from src/pages/admin/main.tsx rename to admin/main.tsx diff --git a/index.html b/index.html index b3a6cbb7..a6b060ca 100644 --- a/index.html +++ b/index.html @@ -8,6 +8,6 @@
- + diff --git a/main.tsx b/main.tsx new file mode 100644 index 00000000..a4015720 --- /dev/null +++ b/main.tsx @@ -0,0 +1,11 @@ +import React from 'react'; +import { render } from 'react-dom'; + +import '@/global.css'; + +render( + +
NO Content
+
, + document.getElementById('root') +); diff --git a/package.json b/package.json index 7f26c19d..cabb72c7 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ "firebase-tools": "^9.16.5", "typescript": "^4.3.2", "vite": "^2.5.0", + "vite-plugin-mpa": "^1.0.3", "vite-tsconfig-paths": "^3.3.13" }, "resolutions": { diff --git a/preview/index.html b/preview/index.html new file mode 100644 index 00000000..b5fef67b --- /dev/null +++ b/preview/index.html @@ -0,0 +1,13 @@ + + + + + + + raduwen-obs-widget + + +
+ + + diff --git a/src/pages/preview/main.tsx b/preview/main.tsx similarity index 100% rename from src/pages/preview/main.tsx rename to preview/main.tsx diff --git a/vite.config.ts b/vite.config.ts index da76c0ea..e106d794 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,17 +1,28 @@ import { defineConfig } from 'vite'; import reactRefresh from '@vitejs/plugin-react-refresh'; import tsconfigPaths from 'vite-tsconfig-paths'; -import { resolve } from 'path'; +import mpa from 'vite-plugin-mpa'; + +var plugins = [tsconfigPaths()]; + +if (process.env.NODE_ENV !== "production") { + plugins.push(reactRefresh()); + plugins.push(mpa({ + scanDir: '.' + }) + ); +} // https://vitejs.dev/config/ export default defineConfig({ build: { rollupOptions: { input: { - main: resolve(__dirname, 'index.html'), - admin: resolve(__dirname, 'admin/index.html'), + main: 'index.html', + preview: 'preview/index.html', + admin: 'admin/index.html' } } }, - plugins: [tsconfigPaths(), reactRefresh()] + plugins, }); diff --git a/yarn.lock b/yarn.lock index d89fbf13..6e81c355 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1708,6 +1708,11 @@ configstore@^5.0.1: write-file-atomic "^3.0.0" xdg-basedir "^4.0.0" +connect-history-api-fallback@1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz#8b32089359308d111115d81cad3fceab888f97bc" + integrity sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg== + connect@^3.6.2: version "3.7.0" resolved "https://registry.yarnpkg.com/connect/-/connect-3.7.0.tgz#5d49348910caa5e07a01800b030d0c35f20484f8" @@ -2690,7 +2695,7 @@ glob-slasher@^1.0.1: lodash.isobject "^2.4.1" toxic "^1.0.0" -glob@^7.1.2, glob@^7.1.3, glob@^7.1.4: +glob@^7.0.0, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4: version "7.1.7" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== @@ -3057,6 +3062,11 @@ install-artifact-from-github@^1.2.0: resolved "https://registry.yarnpkg.com/install-artifact-from-github/-/install-artifact-from-github-1.2.0.tgz#adcbd123c16a4337ec44ea76d0ebf253cc16b074" integrity sha512-3OxCPcY55XlVM3kkfIpeCgmoSKnMsz2A3Dbhsq0RXpIknKQmrX1YiznCeW9cD2ItFmDxziA3w6Eg8d80AoL3oA== +interpret@^1.0.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e" + integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA== + ip-regex@^4.1.0: version "4.3.0" resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-4.3.0.tgz#687275ab0f57fa76978ff8f4dddc8a23d5990db5" @@ -4585,6 +4595,13 @@ readdirp@~3.5.0: dependencies: picomatch "^2.2.1" +rechoir@^0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" + integrity sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q= + dependencies: + resolve "^1.1.6" + recrawl-sync@^2.0.3: version "2.2.1" resolved "https://registry.yarnpkg.com/recrawl-sync/-/recrawl-sync-2.2.1.tgz#cb02c8084c22b3cea103abf46bb88734076ed6bb" @@ -4657,7 +4674,7 @@ require-directory@^2.1.1: resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= -resolve@^1.20.0: +resolve@^1.1.6, resolve@^1.20.0: version "1.20.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== @@ -4868,6 +4885,15 @@ shebang-regex@^3.0.0: resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== +shelljs@0.8.4: + version "0.8.4" + resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.4.tgz#de7684feeb767f8716b326078a8a00875890e3c2" + integrity sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ== + dependencies: + glob "^7.0.0" + interpret "^1.0.0" + rechoir "^0.6.2" + side-channel@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" @@ -5520,6 +5546,15 @@ verror@1.10.0: core-util-is "1.0.2" extsprintf "^1.2.0" +vite-plugin-mpa@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/vite-plugin-mpa/-/vite-plugin-mpa-1.0.3.tgz#1c6ee5a8e8f5ace32e60827433fc73b56d705724" + integrity sha512-qNA0koRvn+iR1KUUjbWS1GRPXqhPCx17hdkpJ3VxdbjjnZcmhtMce/oN/6ww9g7fSN4McdNUO5r8Hsy9axu8kA== + dependencies: + connect-history-api-fallback "1.6.0" + shelljs "0.8.4" + yargs "16.2.0" + vite-tsconfig-paths@^3.3.13: version "3.3.13" 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: resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.7.tgz#61df85c113edfb5a7a4e36eb8aa60ef423cbc90a" integrity sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw== -yargs@^16.1.1: +yargs@16.2.0, yargs@^16.1.1: version "16.2.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==