exounx / vasri
Easy subresource integrity and versioning for local assets
Requires
- php: ^7.1.3
- ext-json: *
- illuminate/console: ^5.8|^6
- illuminate/filesystem: ^5.8|^6
- illuminate/support: ^5.8|^6
Requires (Dev)
- phpunit/phpunit: ^8.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Vasri
Easy subresource integrity and versioning for local assets
This is also meant to replace the Laravel Mix helper.
Install
composer require exounx/vasri
Publish the config
php artisan vendor:publish --provider="ExoUNX\Vasri\Providers\VasriServiceProvider"
Usage
Note: If you use a CDN like Cloudflare that processes your assets at their edge servers, I recommend you disable it and process your scripts beforehand otherwise assets may not load
You'll need to generate the manifest first and every time the assets change
php artisan vasri:build
For CSS
<link rel="stylesheet" {!! vasri('/css/app.css') !!}/>
For JS
<script {!! vasri('/js/app.js') !!}></script>
By default Vasri is configured to read the mix-manifest.json in your public Laravel directory.
If you don't wish to use the mix manifest you can disable it in the config
'mix-manifest' => false,
You'll need to specify your assets manually in the config if you disable mix-manifest support
'assets' => [
'/css/app.css',
'/js/app.js',
]
License
The MIT License (MIT). Please see License File for more information.