solve asset problem (fixed #56, #59)

This commit is contained in:
simialbi 2022-11-30 08:47:12 +01:00
parent 5f4839cf07
commit 67342864ee
No known key found for this signature in database
GPG Key ID: 90C9DF26A55C2070
3 changed files with 15 additions and 17 deletions

View File

@ -20,17 +20,11 @@ class BootstrapAsset extends AssetBundle
* @inheritDoc * @inheritDoc
*/ */
public $sourcePath = '@bower/bootstrap'; public $sourcePath = '@bower/bootstrap';
/** /**
* @inheritDoc * @inheritDoc
*/ */
public $css = [ public $css = [
YII_ENV_PROD ? 'dist/css/bootstrap.min.css' : 'dist/css/bootstrap.css' 'dist/css/bootstrap.css'
];
/**
* @inheritDoc
*/
public $publishOptions = [
'only' => ['scss/*.scss', 'scss/*/*.scss', 'dist/css/bootstrap.*'],
'except' => ['scss/bootstrap-*.scss']
]; ];
} }

View File

@ -11,12 +11,20 @@ namespace yii\bootstrap5;
use yii\web\AssetBundle; use yii\web\AssetBundle;
/**
* Twitter Bootstrap 5 icon bundle
*/
class BootstrapIconAsset extends AssetBundle class BootstrapIconAsset extends AssetBundle
{ {
/**
* @inheritDoc
*/
public $sourcePath = '@vendor/twbs/bootstrap-icons/font'; public $sourcePath = '@vendor/twbs/bootstrap-icons/font';
/**
* @inheritDoc
*/
public $css = [ public $css = [
'bootstrap-icons.css' 'bootstrap-icons.css'
]; ];
} }

View File

@ -20,22 +20,18 @@ class BootstrapPluginAsset extends AssetBundle
* @inheritDoc * @inheritDoc
*/ */
public $sourcePath = '@bower/bootstrap'; public $sourcePath = '@bower/bootstrap';
/** /**
* @inheritDoc * @inheritDoc
*/ */
public $js = [ public $js = [
YII_ENV_PROD ? 'dist/js/bootstrap.bundle.min.js' : 'dist/js/bootstrap.bundle.js' 'dist/js/bootstrap.bundle.js'
];
/**
* @inheritDoc
*/
public $publishOptions = [
'only' => ['dist/js/bootstrap.bundle.*', 'js/src/*.js', 'js/src/*/*.js']
]; ];
/** /**
* @inheritDoc * @inheritDoc
*/ */
public $depends = [ public $depends = [
BootstrapAsset::class 'yii\bootstrap5\BootstrapAsset'
]; ];
} }