Update BootstrapAsset (#52)

* Update BootstrapAsset

- Load minified JS on production
- Optimize list of publishes files
- Normalize comments

* Update CHANGELOG.md

* Update CHANGELOG.md
This commit is contained in:
Anton 2022-10-13 15:11:49 +03:00 committed by GitHub
parent 9e944cd085
commit 3111ba58fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 5 deletions

View File

@ -9,6 +9,7 @@ Yii Framework 2 bootstrap5 extension Change Log
- Enh #40: Breadcrumbs refactoring (WinterSilence)
- Bug #46: Fix data-attribute usage for Dropdown toggle (machour)
- Enh #48: Update `BootstrapWidgetTrait` to initialize JS plugins without jQuery (WinterSilence)
- Bug #52: Update `BootstrapAsset` to load minified CSS on production, optimize and fix list of publishes files (WinterSilence)
2.0.3 April 22, 2022

View File

@ -1,8 +1,8 @@
<?php
/**
* @link http://www.yiiframework.com/
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
* @license https://www.yiiframework.com/license/
*/
declare(strict_types=1);
@ -11,11 +11,26 @@ namespace yii\bootstrap5;
use yii\web\AssetBundle;
/**
* Twitter Bootstrap 5 CSS bundle.
*/
class BootstrapAsset extends AssetBundle
{
public $sourcePath = '@bower/bootstrap/dist';
/**
* @inheritDoc
*/
public $sourcePath = '@bower/bootstrap';
/**
* @inheritDoc
*/
public $css = [
'css/bootstrap.css',
YII_ENV_PROD ? 'dist/css/bootstrap.min.css' : 'dist/css/bootstrap.css'
];
/**
* @inheritDoc
*/
public $publishOptions = [
'only' => ['scss/*.scss', 'scss/*/*.scss', 'dist/css/bootstrap.*'],
'except' => ['scss/bootstrap-*.scss']
];
public $js = [];
}