How To Prevent Less Files To Be Included In Source

I created a new default Yii2 app and tried to use my own styles. My CSS files are placed after the bootstrap.css but they still get overwritten. I checked it with Chrome Dev Tools and realised that Bootstrap’s *.less files got included and they overwrite my styles.

Is there any way to prevent LESS files to be included?

Seems like the problem is related to the Yii debugger toolbar. If I don’t set the YII_ENV to “dev” then it works fine (the Yii debugger is not there). But if the YII_ENV is set to “dev” then my styles got overwritten.

Also, I don’t see the “hide” option of the Yii debugger in this project, while I see that in my other Yii2 projects. In this project, the debugger is always open. I see the “Available Debug Data” in a GridView while this is not the case in my other Yii2 projects.

You can eliminate the debug toolbar forever in your application by commenting/removing this line from your app config file:

'preload' => [



Check where this line lies in which of your config files (main, main-local, etc.) and comment out.