0
私はいくつかのAsstesを公開したいと思います。たとえば、bowerやcomposerによってdonateされたanimate.cssは、必要ではないファイルをweb asstesフォルダにコピーしたいと考えています。 既にパブリッシュオプションを使用していますが、一部のフォルダはコピーされますが、コンテンツは含まれません。Yii2アセットは、公開時にファイル、ディレクトリを除外します
sourcefolderは次のようになります。
/animate.css
./bower.json
./source
./source/bouncing_exits
./source/bouncing_exits/bounceOutLeft.css
./source/bouncing_exits/bounceOutDown.css
./source/bouncing_exits/bounceOutUp.css
./source/bouncing_exits/bounceOutRight.css
./source/bouncing_exits/bounceOut.css
./source/fading_exits
./source/fading_exits/fadeOutRight.css
./source/fading_exits/fadeOutLeft.css
./source/fading_exits/fadeOutDown.css
./source/fading_exits/fadeOutUp.css
./source/fading_exits/fadeOutLeftBig.css
./source/fading_exits/fadeOut.css
./source/fading_exits/fadeOutRightBig.css
./source/fading_exits/fadeOutDownBig.css
./source/fading_exits/fadeOutUpBig.css
./source/fading_entrances
./source/fading_entrances/fadeInRight.css
./source/fading_entrances/fadeInUp.css
... some more
./animate-config.json
./package.json
./gulpfile.js
./animate.min.css
./LICENSE
資産バンドルがこの
namespace frontend\assets;
use yii\web\AssetBundle;
/**
* Main frontend application asset bundle.
*/
class AnimateAsset extends AssetBundle
{
/**
* @inherit
*/
public $sourcePath = '@bower/animate.css';
/**
* @inherit
*/
public $css = [
'animate.min.css',
];
/**
* @inherit
*/
public $js = [
];
/**
* @inherit
*/
public $depends = [
'yii\web\YiiAsset',
'yii\bootstrap\BootstrapAsset',
'yii\bootstrap\BootstrapPluginAsset',
];
public $publishOptions = [
// 'forceCopy' => YII_DEBUG,
'only' => [
'animate.min.css',
],
'exept' => [
'source/*',
'source/',
'source',
],
];
}
のように見え、finalyウェブ・アセットフォルダ内の結果は、この
./source
./source/bouncing_exits
./source/fading_exits
./source/fading_entrances
./source/lightspeed
./source/zooming_entrances
./source/zooming_exits
./source/bouncing_entrances
./source/rotating_entrances
./source/attention_seekers
./source/sliding_exits
./source/rotating_exits
./source/flippers
./source/specials
./source/sliding_entrances
./animate.min.css
空のように見えますフォルダはまだコピーされますか? どうすればこの問題を防ぐことができますか?
の作品の下にあなたは、単に代わりに 'exept' – soju
THXたくさんのexcept''試してみてください!!それは非常にうまく動作します;) –