diff --git a/CHANGELOG.md b/CHANGELOG.md index b420975..f690a02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 #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) diff --git a/src/BootstrapPluginAsset.php b/src/BootstrapPluginAsset.php index f194edb..a3558ef 100644 --- a/src/BootstrapPluginAsset.php +++ b/src/BootstrapPluginAsset.php @@ -1,8 +1,8 @@ + * Twitter Bootstrap 5 JavaScript bundle. */ class BootstrapPluginAsset extends AssetBundle { - public $sourcePath = '@bower/bootstrap/dist'; + /** + * @inheritDoc + */ + public $sourcePath = '@bower/bootstrap'; + /** + * @inheritDoc + */ 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 = [ - BootstrapAsset::class, + BootstrapAsset::class ]; }