Closed knoppixmeister closed 1 year ago
Hmm, isn't it a problem with the minimizer you are using?
I use following code in controller's init method for minimizing output on the fly
` class SiteController extends \yii\web\Controller { public function init() { parent::init();
ob_start(function($b) {
$res = preg_replace(['/\>[^\S ]+/s','/[^\S ]+\</s','/(\s)+/s'], ['>', '<', '\\1'], $b);
$res = str_replace(["\r\n", "\n", "\r"], " ", $res);
return $res;
});
}
.... .... `
So, because of all debug assets JS files injected directly in html output (not linked as separated JS files) the code above breaks overall JS work.
Also i already rewritten all js files for correct work in minimized mode in debug assets but it will break after package update thru composer.
Also there are few places where used "/ /" style commnets not "//"
It's clearly a problem on your side, you could just improve the preg_replace. I know that this change is super easy and should not impact anything but this is just wrong. Anyway @yiisoft/reviewers ?
Minimizer regex is to be fixed.
Is it possible/allowed to rewrite all "//" (double slashes) comments in assets/js/toolbar.js file (may be even somewhere else in other file(s)) into "/ ... /" style comments? Otherwise when we have minimized html output all JS scripts breaks because of this comments.