Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

feat(vite): add Cloudflare async script and style tag attributes

Andras Bacsai98a9985dcee7
diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php
index 329482230f..a783ed17e3 100644
--- a/app/Providers/AppServiceProvider.php
+++ b/app/Providers/AppServiceProvider.php
@@ -7,6 +7,7 @@ use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Http;
+use Illuminate\Support\Facades\Vite;
use Illuminate\Support\ServiceProvider;
use Illuminate\Validation\Rules\Password;
use Laravel\Sanctum\Sanctum;
@@ -28,6 +29,14 @@ class AppServiceProvider extends ServiceProvider
$this->configurePasswords();
$this->configureSanctumModel();
$this->configureGitHubHttp();
+
+ Vite::useScriptTagAttributes([
+ 'data-cfasync' => 'false',
+ ]);
+
+ Vite::useStyleTagAttributes([
+ 'data-cfasync' => 'false',
+ ]);
}
private function configureCommands(): void