only compile when it's actually necessary #4361
ritschwumm
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
hi!
to minimize turnaround times in my typescript projects, i try to avoid as much work in my builds as possible - especially compiling anything when i have the output already and the sources did not change. this works well for most tools used in my builds, with one exception: lessc, which therefore eats about 95% of my build time.
i tried to abuse
--depends
to implement all this in a wrapper script, without much success though.--depends
is just too specialized to the usecase of generating makefiles to be really useful, and more importantly cannot be used at the same time as writing output files. discussing #2925, i came to the conclusion this cannot be done cleanly without the help of lessc itself.so, what do you need to avoid compilation if nothing changed? not much actually, and all of it is known after lessc is done compiling.
.css
.css.map
index.less
) andif now some previous compilation saved the above information in some file named
state.json
, lessc could easily determine there is nothing to do and exit early by checking thatstate.json
exists and can be loadedon a side note, a modification time is not a great indicator for whether a file changed, but often good enough.
one could investigate using a checksum instead - no idea how much that would impact performance.
Beta Was this translation helpful? Give feedback.
All reactions