Moves Livewire into App JS

Makes it easier to bundle for prod.
This commit is contained in:
Refringe 2024-06-19 12:56:33 -04:00
parent 169777f957
commit 5aafbe94d1
Signed by: Refringe
SSH Key Fingerprint: SHA256:t865XsQpfTeqPRBMN2G6+N8wlDjkgUCZF3WGW6O9N/k
6 changed files with 21 additions and 14 deletions

View File

@ -1,12 +1,9 @@
{
"name": "laravel/laravel",
"name": "sp-tarkov/forge",
"type": "project",
"description": "The skeleton application for the Laravel framework.",
"keywords": [
"laravel",
"framework"
],
"license": "MIT",
"description": "A Laravel-based web application that provides a platform for the Single Player Tarkov community to share and discover user-generated content, such as mods, guides, and other tools.",
"keywords": [],
"license": "MPL-2.0",
"require": {
"php": "^8.3",
"ext-curl": "*",

2
package-lock.json generated
View File

@ -1,5 +1,5 @@
{
"name": "html",
"name": "forge",
"lockfileVersion": 3,
"requires": true,
"packages": {

View File

@ -5,9 +5,15 @@ import.meta.glob(["../video/**"]);
document.addEventListener("DOMContentLoaded", function() {
const themeToggleIcon = {
dark: document.getElementById("theme-toggle-dark-icon"),
light: document.getElementById("theme-toggle-light-icon"),
light: document.getElementById("theme-toggle-light-icon")
};
// Make sure the theme toggle icons are available.
if (themeToggleIcon.dark === null || themeToggleIcon.light === null) {
console.log("Theme toggle icons not found.");
return;
}
// Function to update the visibility of the theme icons based on the theme
function updateIconVisibility(theme) {
if (theme === "dark") {

View File

@ -1,4 +1,7 @@
import { Livewire } from "../../vendor/livewire/livewire/dist/livewire.esm";
import axios from "axios";
Livewire.start();
window.axios = axios;
window.axios.defaults.headers.common["X-Requested-With"] = "XMLHttpRequest";

View File

@ -56,6 +56,6 @@
@livewire('global-search')
@stack('modals')
@livewireScripts
@livewireScriptConfig
</body>
</html>

View File

@ -11,6 +11,8 @@
<link href="//fonts.bunny.net" rel="preconnect">
<link href="//fonts.bunny.net/css?family=figtree:400,500,600&display=swap" rel="stylesheet">
<link href="{{ config('app.asset_url') }}" rel="dns-prefetch">
<script>
// Immediately set the theme to prevent a flash of the default theme when another is set.
// Must be located inline, in the head, and before any CSS is loaded.
@ -33,7 +35,6 @@
{{ $slot }}
</div>
@livewireScripts
@livewireScriptConfig
</body>
</html>