diff --git a/Caddyfile b/Caddyfile new file mode 100644 index 0000000..e5e1808 --- /dev/null +++ b/Caddyfile @@ -0,0 +1,6 @@ +:80 { + reverse_proxy localhost:5173 + handle /php/* { + reverse_proxy localhost:8000 + } +} \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..54fec6a --- /dev/null +++ b/index.html @@ -0,0 +1,16 @@ + + + + + + + NASLOV + + + + + +
+ + + \ No newline at end of file diff --git a/index.php b/index.php deleted file mode 100644 index 037bc73..0000000 --- a/index.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - NASLOV - - - - - - - - - -
- - - - - - - - - \ No newline at end of file diff --git a/package.json b/package.json index 418c60b..29c3cb3 100644 --- a/package.json +++ b/package.json @@ -3,10 +3,8 @@ "version": "1.0.0", "type": "module", "scripts": { - "build": "vite build", - "build-dev": "vite build --mode development", - "dev": "vite build --mode development --watch", - "serve": "concurrently \"vite\" \"cross-env DEV=1 php -S localhost:8000\" \"mailpit\"" + "build": "vite build && cp -R php dist/php", + "serve": "concurrently \"vite\" \"php -S localhost:8000\" \"mailpit\" \"caddy run --config Caddyfile\"" }, "dependencies": { "@fortawesome/fontawesome-free": "7.3.1", diff --git a/php/notifications.php b/php/notifications.php new file mode 100644 index 0000000..08e17c8 --- /dev/null +++ b/php/notifications.php @@ -0,0 +1,5 @@ + ({ +export default defineConfig(() => ({ plugins: [ VueI18n({ include: fileURLToPath(new URL('./vue/locales/**', import.meta.url)), @@ -15,7 +15,6 @@ export default defineConfig(({ mode }) => ({ }), vue(), ], - base: './', server: { port: 5173, strictPort: true, @@ -29,24 +28,7 @@ export default defineConfig(({ mode }) => ({ outDir: 'dist', emptyOutDir: true, rolldownOptions: { - input: { app: './vue/main.js' }, - output: { - entryFileNames: 'app.js', - manualChunks: undefined, - assetFileNames: (asset) => { - const name = asset.names?.[0] ?? ''; - if (name.endsWith('.css')) { - return 'assets/app.css'; - } - return 'assets/[name]-[hash][extname]'; - }, - } + input: { index: './index.html' }, } - }, - define: { - __VUE_PROD_DEVTOOLS__: mode === 'development' ? 'true' : 'false' - }, - esbuild: { - drop: mode === 'development' ? [] : ['console', 'debugger'] } })) diff --git a/vue/app.vue b/vue/app.vue index e73c2d7..3f3b836 100644 --- a/vue/app.vue +++ b/vue/app.vue @@ -1,13 +1,17 @@ - \ No newline at end of file diff --git a/vue/i18n.js b/vue/i18n.js index 05a62d3..87a09b1 100644 --- a/vue/i18n.js +++ b/vue/i18n.js @@ -13,7 +13,7 @@ const loadedLocales = new Set() async function loadLocaleMessages(locale) { if (!loadedLocales.has(locale)) { - const messages = await import(`../locales/${locale}.json`) + const messages = await import(`./locales/${locale}.json`) i18n.global.setLocaleMessage(locale, messages.default) loadedLocales.add(locale) } diff --git a/vue/routes/index.vue b/vue/routes/index.vue index cfb4593..bbdc1ad 100644 --- a/vue/routes/index.vue +++ b/vue/routes/index.vue @@ -1,9 +1,16 @@ \ No newline at end of file