exounx/vasri
Composer 安装命令:
composer require exounx/vasri
包简介
Easy subresource integrity and versioning for local assets
README 文档
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.
统计信息
- 总下载量: 339
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-09-03