Update BootstrapPluginAsset (#51)

* Update BootstrapPluginAsset

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

* Update BootstrapPluginAsset.php

* Update BootstrapPluginAsset.php

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

View File

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

View File

@ -1,8 +1,8 @@
<?php <?php
/** /**
* @link http://www.yiiframework.com/ * @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC * @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/ * @license https://www.yiiframework.com/license/
*/ */
declare(strict_types=1); declare(strict_types=1);
@ -12,17 +12,30 @@ namespace yii\bootstrap5;
use yii\web\AssetBundle; use yii\web\AssetBundle;
/** /**
* Asset bundle for the Twitter bootstrap javascript files. * Twitter Bootstrap 5 JavaScript bundle.
*
* @author Qiang Xue <qiang.xue@gmail.com>
*/ */
class BootstrapPluginAsset extends AssetBundle class BootstrapPluginAsset extends AssetBundle
{ {
public $sourcePath = '@bower/bootstrap/dist'; /**
* @inheritDoc
*/
public $sourcePath = '@bower/bootstrap';
/**
* @inheritDoc
*/
public $js = [ public $js = [
'js/bootstrap.bundle.js', YII_ENV_PROD ? 'dist/js/bootstrap.bundle.min.js' : 'dist/js/bootstrap.bundle.js'
]; ];
/**
* @inheritDoc
*/
public $publishOptions = [
'only' => ['dist/js/bootstrap.bundle.*', 'js/src/*.js', 'js/src/*/*.js']
];
/**
* @inheritDoc
*/
public $depends = [ public $depends = [
BootstrapAsset::class, BootstrapAsset::class
]; ];
} }