i try follow sass guidelines style sheets. guidelines suggest putting code in files topically sorted 7 folder (6 in our case, due how yii handles dependencies).
the yii2 assets pipeline seems watch $sourcepath
changes, ignoring subdirectories. changing file in subdirectories doesn't trigger recompilation. had force recompilation via $config['components']['assetmanager']['forcecopy'] = true;
ensure compiled on page reload after. recompiles assets , takes 3 times long recompiling scss
files. working on potato became annoying.
is there simple way let yii asset pipeline know subdirectories can away full recompilation every time?
as matter of fact can, requires bit of effort.
in asssetbundle::init()
-function, see if of subfolders has modification time more recent 1 normal folder, set forcecopy true.
public function init() { parent::init(); $modified = filemtime($this->sourcepath) foreach(['my', 'list', 'of', 'subfolders'] $folder) { $subfoldermodified = filemtime($this->sourcepath . '/' . $folder); if ($subfoldermodified > $modified) { $this->publishoptions['forcecopy'] = true; break; } } }
note largely dummy code, serves show gist of idea.
Comments
Post a Comment