Jump to content


Photo
- - - - -

Complied LESS not updating when files are modified.


  • Please log in to reply
5 replies to this topic

#1 bxbmedia

bxbmedia

    Advanced Member

  • Members

  • 79 posts
  • LocationAnn Arbor, MI

Posted 02 July 2012 - 08:45 PM

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');
	}


#2 Simon_P

Simon_P

    Messer

  • Administrators
  • 8388607 posts
  • LocationDevon
  • Framework Version:2.0
  • Country: Country Flag

Posted 02 July 2012 - 08:50 PM

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!

#3 bxbmedia

bxbmedia

    Advanced Member

  • Members

  • 79 posts
  • LocationAnn Arbor, MI

Posted 02 July 2012 - 09:10 PM

Thanks for the quick response Simon. Shouldn't the compiled LESS be recompiled when files are modified or no?

#4 Simon_P

Simon_P

    Messer

  • Administrators
  • 8388607 posts
  • LocationDevon
  • Framework Version:2.0
  • Country: Country Flag

Posted 02 July 2012 - 09:11 PM

No, that would mean checking the mtime on every file!

#5 bxbmedia

bxbmedia

    Advanced Member

  • Members

  • 79 posts
  • LocationAnn Arbor, MI

Posted 12 July 2012 - 08:58 PM

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.

#6 Danny

Danny

    Is Awesome!

  • Moderators
  • 13075 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 13 July 2012 - 12:11 PM

Hi bxbmedia, Is your issue now resolved, or do you require further assistance.