diff --git a/package-lock.json b/package-lock.json index 4d9433ac..108c0a1b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,6 +20,7 @@ "sass": "^1.74.1", "sql-formatter": "^4.0.2", "vite": "^5.2.8", + "vite-plugin-manifest-sri": "^0.2.0", "vue": "^2.7.16", "vue-json-pretty": "^1.9.5", "vue-router": "^3.6.5" @@ -1571,6 +1572,12 @@ "picomatch": "^2.3.1" } }, + "node_modules/vite-plugin-manifest-sri": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/vite-plugin-manifest-sri/-/vite-plugin-manifest-sri-0.2.0.tgz", + "integrity": "sha512-Zt5jt19xTIJ91LOuQTCtNG7rTFc5OziAjBz2H5NdCGqaOD1nxrWExLhcKW+W4/q8/jOPCg/n5ncYEQmqCxiGQQ==", + "dev": true + }, "node_modules/vue": { "version": "2.7.16", "resolved": "https://registry.npmjs.org/vue/-/vue-2.7.16.tgz", @@ -2564,6 +2571,12 @@ "picomatch": "^2.3.1" } }, + "vite-plugin-manifest-sri": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/vite-plugin-manifest-sri/-/vite-plugin-manifest-sri-0.2.0.tgz", + "integrity": "sha512-Zt5jt19xTIJ91LOuQTCtNG7rTFc5OziAjBz2H5NdCGqaOD1nxrWExLhcKW+W4/q8/jOPCg/n5ncYEQmqCxiGQQ==", + "dev": true + }, "vue": { "version": "2.7.16", "resolved": "https://registry.npmjs.org/vue/-/vue-2.7.16.tgz", diff --git a/package.json b/package.json index 8830d78e..a1ece21b 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "sass": "^1.74.1", "sql-formatter": "^4.0.2", "vite": "^5.2.8", + "vite-plugin-manifest-sri": "^0.2.0", "vue": "^2.7.16", "vue-json-pretty": "^1.9.5", "vue-router": "^3.6.5" diff --git a/resources/views/layout.blade.php b/resources/views/layout.blade.php index c08d4ad1..700393c8 100644 --- a/resources/views/layout.blade.php +++ b/resources/views/layout.blade.php @@ -1,8 +1,20 @@ @php use Illuminate\Support\Facades\Vite; +use Illuminate\Foundation\Vite as ViteFoundation; + +$viteDataSchemaLight = new ViteFoundation(); +$viteDataSchemaLight->useStyleTagAttributes([ +'data-schema' => 'light', +]); + +$viteDataSchemaDark = new ViteFoundation(); +$viteDataSchemaDark->useStyleTagAttributes([ +'data-schema' => 'dark', +]); @endphp + @@ -16,10 +28,8 @@ - - - - + {{ $viteDataSchemaLight('resources/sass/styles.scss', 'vendor/horizon') }} + {{ $viteDataSchemaDark('resources/sass/styles-dark.scss', 'vendor/horizon') }}
@@ -147,6 +157,6 @@ window.Horizon = @json($horizonScriptVariables); - @vite('resources/js/app.js', 'vendor/horizon') +@vite('resources/js/app.js', 'vendor/horizon') diff --git a/vite.config.mjs b/vite.config.mjs index 2358f9d4..aa696725 100644 --- a/vite.config.mjs +++ b/vite.config.mjs @@ -1,6 +1,7 @@ import vue2 from "@vitejs/plugin-vue2"; import { defineConfig } from "vite"; import laravel from "laravel-vite-plugin"; +import manifestSRI from "vite-plugin-manifest-sri"; const config = defineConfig({ plugins: [ @@ -10,6 +11,7 @@ const config = defineConfig({ "resources/js/app.js", ]), vue2(), + manifestSRI(), ], resolve: { alias: {