-
-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Go over if we should include an app.js file instead of using the Alpine.js CDN #2026
Closed
Tracked by
#1499
Comments
caendesilva
changed the title
Go over if we should include an app.js file instead of using the Alpine.js CDN (or if we actually need app.js (useful mainly for offline sites), or a command/easy way to include it. maybe easy way to disable the cdn)
Go over if we should include an app.js file instead of using the Alpine.js CDN
Nov 16, 2024
Claude Sonnet
Currently, the Alpine.js setup is handled in the following ways:
{{-- Alpine.js --}}
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/cdn.min.js" integrity="sha256-gOkV4d9/FmMNEkjOzVlyM2eNAWSUXisT+1RbMTTIgXI=" crossorigin="anonymous"></script>
/*
* This is the main JavaScript used by Vite to build the app.js file.
*/
rollupOptions: {
input: [
resolve(__dirname, 'resources/assets/app.js'),
resolve(__dirname, 'resources/assets/app.css')
],
output: {
entryFileNames: '[name].js',
chunkFileNames: '[name].js',
assetFileNames: '[name].[ext]'
}
} Based on the codebase analysis, here are my recommendations:
php hyde download:alpine
### JavaScript Assets
By default, Hyde loads Alpine.js from a CDN for optimal performance. However, if you need offline capabilities or prefer local assets:
1. Disable the CDN in config/hyde.php:
```php
'load_alpine_from_cdn' => false
php hyde download:alpine This will serve Alpine.js from your local environment instead of the CDN.
|
I think having the Alpine CDN is nice. We don't have enough scripts to need to bundle them together. Offline usage can be handled by the user if they need it. Not within the 99% use case. Instead, see #2027 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Go over if we should include an app.js file instead of using the Alpine.js CDN (or if we actually need app.js, which is useful mainly for offline sites), or a command/easy way to include it, maybe an easy way to disable the CDN.
The text was updated successfully, but these errors were encountered: