Jump to content
Sign in to follow this  
bxbmedia

Complied LESS not updating when files are modified.

Recommended Posts

bxbmedia

I just started using 2.2.1 today and I've been having a different problem that I haven't read about here yet. I am using a child theme to customize my framework and using style.less in my child's root directory for my custom less code. I've noticed (and tested) that the compiled less does not get recompiled after the style/color.less files are updated. It seems like this is handled by transients that expire after a time or programatically. It's not that I haven't seen it recompiled at all, but normal things that I would think should cause a reload do not - like updating any of the less files, reloading a page, browsing to another page, or enabling pagelines debug option. It seems to recompile after some time but the important thing is that it isn't recompiling when it should - that is when the source files are modified. What normally triggers the compiled less to get recompiled? I've hacked a solution that works at the moment by adding this to my functions.php:

add_action('init','expire_less');
	function expire_less() {
		delete_transient('pagelines_core_css');
		delete_transient('pagelines_sections_css');
	}


gl hf

Share this post


Link to post
Share on other sites
Simon
Add this to wp-config.php: define( 'PL_LESS_DEV', true ); it will compile on EVERY pageload, so be sure to remove it on a production site!

Share this post


Link to post
Share on other sites
bxbmedia
Thanks for the quick response Simon. Shouldn't the compiled LESS be recompiled when files are modified or no?

gl hf

Share this post


Link to post
Share on other sites
Simon
No, that would mean checking the mtime on every file!

Share this post


Link to post
Share on other sites
bxbmedia
Thanks Simon, I figured that's how it would be done. I assume you guys have done a lot of performance testing, I don't know how much overhead that would add to do those checks.

gl hf

Share this post


Link to post
Share on other sites
Danny
Hi bxbmedia, Is your issue now resolved, or do you require further assistance.

Please search our forums, before posting!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×