lesscss-maven-plugin
lesscss-maven-plugin copied to clipboard
Replace less files by css in html files
Hi Marcel,
Thanks for work.
Using the plugin I have found something which could be great to add to your plugin, replacing in html files the less stylesheets by the new css ones generated.
Maybe other people have the same need ?
What do you think about it ?
Regards,
Maxime
I had the same need ^^ I'm calling compile goal during generate-resources phase, and then altering the html files in process-resources phase, via ant:
<echo>Replacing .less imports by .css imports</echo>
<replace dir="${outputDirectory}" summary="true" token=".less" value=".css">
<include name="**/*.htm*" />
</replace>
<replace dir="${outputDirectory}" summary="true" token="stylesheet/less" value="stylesheet">
<include name="**/*.htm*" />
</replace>
<echo>Removing less.js import</echo>
<replaceregexp match="<script.*less.js.*</script>" replace="">
<fileset dir="${outputDirectory}">
<include name="**/*.htm*" />
</fileset>
</replaceregexp>
Seems like a standard processing when you want to work in browser mode during development and switch to compile mode during build. Maybe it could be handled by another goal of the plugin ?