From 0e88b9b198791e0d73df3812fea441228193c1dc Mon Sep 17 00:00:00 2001 From: Brian Rogers Date: Wed, 29 Jun 2022 13:46:07 -0600 Subject: [PATCH] minor tweaks to how JS is set up --- src/package.json | 14 +++++++------- src/resources/js/app.js | 14 ++++++++------ src/resources/js/bootstrap.js | 6 +++++- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/package.json b/src/package.json index 1096b0d..a652e5e 100644 --- a/src/package.json +++ b/src/package.json @@ -9,6 +9,12 @@ "prod": "npm run production", "production": "mix --production" }, + "devDependencies": { + "laravel-mix": "^6.0.43", + "postcss": "^8.4.14", + "postcss-import": "^14.1.0", + "vue-loader": "^17.0.0" + }, "dependencies": { "@inertiajs/inertia": "^0.11.0", "@inertiajs/inertia-vue3": "^0.6.0", @@ -22,13 +28,7 @@ "lodash": "^4.17.21", "notiwind": "^1.2.5", "tailwindcss": "^3.0.24", - "tailwindcss-neumorphism": "^0.1.0", + "tailwindcss-neu": "^0.2.1", "vue": "^3.2.36" - }, - "devDependencies": { - "laravel-mix": "^6.0.43", - "postcss": "^8.4.14", - "postcss-import": "^14.1.0", - "vue-loader": "^17.0.0" } } \ No newline at end of file diff --git a/src/resources/js/app.js b/src/resources/js/app.js index 357e8a5..b3245e2 100644 --- a/src/resources/js/app.js +++ b/src/resources/js/app.js @@ -1,14 +1,15 @@ require("./bootstrap"); -import { createApp, h } from "vue"; -import { createInertiaApp } from "@inertiajs/inertia-vue3"; -import { InertiaProgress } from "@inertiajs/progress"; -import Notifications from "notiwind"; +import { createApp, h } from 'vue'; +import { createInertiaApp } from '@inertiajs/inertia-vue3'; +import { InertiaProgress } from '@inertiajs/progress'; +import { ZiggyVue } from '../../vendor/tightenco/ziggy/dist/vue.m'; +import Notifications from 'notiwind'; -const appName = window.document.getElementsByTagName("title")[0]?.innerText || "Laravel"; +const appName = window.document.getElementsByTagName('title')[0]?.innerText || 'Laravel'; window.genUid = function () { - return [...Array(16)].map(() => Math.floor(Math.random() * 16).toString(16)).join(""); + return [...Array(16)].map(() => Math.floor(Math.random() * 16).toString(16)).join(''); }; createInertiaApp({ @@ -18,6 +19,7 @@ createInertiaApp({ return createApp({ render: () => h(app, props) }) .use(plugin) .use(Notifications) + .use(ZiggyVue, Ziggy) .mixin({ methods: { route } }) .mount(el); }, diff --git a/src/resources/js/bootstrap.js b/src/resources/js/bootstrap.js index 870b3c1..9744bd2 100644 --- a/src/resources/js/bootstrap.js +++ b/src/resources/js/bootstrap.js @@ -23,5 +23,9 @@ window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; // broadcaster: 'pusher', // key: process.env.MIX_PUSHER_APP_KEY, // cluster: process.env.MIX_PUSHER_APP_CLUSTER, -// forceTLS: true +// wsHost: import.meta.env.MIX_PUSHER_HOST ?? `ws-${import.meta.env.MIX_PUSHER_CLUSTER}.pusher.com`, +// wsPort: import.meta.env.MIX_PUSHER_PORT ?? 80, +// wssPort: import.meta.env.MIX_PUSHER_PORT ?? 443, +// forceTLS: (import.meta.env.MIX_PUSHER_SCHEME ?? 'https') === 'https', +// enabledTransports: ['ws', 'wss'], // });