{"id":1685,"date":"2016-02-05T01:59:16","date_gmt":"2016-02-04T20:29:16","guid":{"rendered":"http:\/\/judepereira.com\/blog\/?p=1685"},"modified":"2016-02-05T01:59:16","modified_gmt":"2016-02-04T20:29:16","slug":"compile-less-on-the-fly-for-your-exploded-war-in-intellij","status":"publish","type":"post","link":"https:\/\/judepereira.com\/blog\/compile-less-on-the-fly-for-your-exploded-war-in-intellij\/","title":{"rendered":"Compile LESS on the fly for your exploded WAR in IntelliJ"},"content":{"rendered":"<p>At CleverTap, we&#8217;ve recently started using LESS for dynamic CSS. While it has it&#8217;s upsides, the biggest downside\u00a0was that most of our developers couldn&#8217;t use the hot deploy feature for their local deployments.<\/p>\n<p>After an hour or so, we came up with a neat solution.<\/p>\n<p>&nbsp;<\/p>\n<p>There are two parts to this:<\/p>\n<ol>\n<li>Just before deploying the app into the web container, compile all the LESS files within the exploded artifact output directory<\/li>\n<li>Have the File Watcher plugin re-compile a modified LESS file within the IDE, and copy it over to the artifact output directory<\/li>\n<\/ol>\n<p>Both parts above utilize a\u00a0bash script (since everybody uses a Mac for development, it&#8217;s cool).<\/p>\n<h2>Prerequisites:<\/h2>\n<ol>\n<li>The LESS compiler &#8211; can be installed using npm (npm install -g less). If you don&#8217;t have the Node Package Manager, just search on how to install it (most likely you&#8217;d use Homebrew)<\/li>\n<li>Install the File Watcher plugin in IntelliJ\n<ol>\n<li>Go to\u00a0Preferences in IDEA, then to Plugins<\/li>\n<li>Hit the &#8220;Install JetBrains plugin&#8230;&#8221; button, and search for &#8220;file watchers&#8221;.<\/li>\n<li>Install the plugin and restart the IDE<\/li>\n<\/ol>\n<\/li>\n<li>A run configuration that is configured to deploy an exploded WAR (can be either Tomcat\/Jetty\/anything)<\/li>\n<li>Knowing where your exploded artifact resides (in my case, it is \/Users\/jude\/developer\/WizRocket\/out\/artifacts\/Dashboard_war_exploded). If you don&#8217;t know how to get this, follow these steps:\n<ol>\n<li>Go to File -&gt; Project Structure<\/li>\n<li>Click on Artifacts (in the left menu)<\/li>\n<li>Select your exploded WAR artifact<\/li>\n<li>On the right, you&#8217;ll see the output directory<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<h2>Part 1: Compile the LESS into CSS just before deployment<\/h2>\n<p>Copy the following script and save it as\u00a0\/Users\/username\/bin\/lessc-idea:<\/p>\n<style>.gist table { margin-bottom: 0; }<\/style>\n<div style=\"tab-size: 8\" id=\"gist30817743\" class=\"gist\">\n<div class=\"gist-file\" translate=\"no\" data-color-mode=\"light\" data-light-theme=\"light\">\n<div class=\"gist-data\">\n<div class=\"js-gist-file-update-container js-task-list-container\">\n<div id=\"file-lessc-idea-sh\" class=\"file my-2\">\n<div itemprop=\"text\"\n      class=\"Box-body p-0 blob-wrapper data type-shell  \"\n      style=\"overflow: auto\" tabindex=\"0\" role=\"region\"\n      aria-label=\"lessc-idea.sh content, created by judepereira on 07:45PM on February 04, 2016.\"\n    ><\/p>\n<div class=\"js-check-hidden-unicode js-blob-code-container blob-code-content\">\n<p>  <template class=\"js-file-alert-template\"><\/p>\n<div data-view-component=\"true\" class=\"flash flash-warn flash-full d-flex flex-items-center\">\n  <svg aria-hidden=\"true\" height=\"16\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" data-view-component=\"true\" class=\"octicon octicon-alert\">\n    <path d=\"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"><\/path>\n<\/svg><br \/>\n    <span><br \/>\n      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.<br \/>\n      <a class=\"Link--inTextBlock\" href=\"https:\/\/github.co\/hiddenchars\" target=\"_blank\">Learn more about bidirectional Unicode characters<\/a><br \/>\n    <\/span><\/p>\n<div data-view-component=\"true\" class=\"flash-action\">        <a href=\"{{ revealButtonHref }}\" data-view-component=\"true\" class=\"btn-sm btn\">    Show hidden characters<br \/>\n<\/a>\n<\/div>\n<\/div>\n<p><\/template><br \/>\n<template class=\"js-line-alert-template\"><br \/>\n  <span aria-label=\"This line has hidden Unicode characters\" data-view-component=\"true\" class=\"line-alert tooltipped tooltipped-e\"><br \/>\n    <svg aria-hidden=\"true\" height=\"16\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" data-view-component=\"true\" class=\"octicon octicon-alert\">\n    <path d=\"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"><\/path>\n<\/svg><br \/>\n<\/span><\/template><\/p>\n<table data-hpc class=\"highlight tab-size js-file-line-container\" data-tab-size=\"4\" data-paste-markdown-skip data-tagsearch-path=\"lessc-idea.sh\">\n<tr>\n<td id=\"file-lessc-idea-sh-L1\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"1\"><\/td>\n<td id=\"file-lessc-idea-sh-LC1\" class=\"blob-code blob-code-inner js-file-line\">#!\/bin\/bash<\/td>\n<\/tr>\n<tr>\n<td id=\"file-lessc-idea-sh-L2\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"2\"><\/td>\n<td id=\"file-lessc-idea-sh-LC2\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-lessc-idea-sh-L3\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"3\"><\/td>\n<td id=\"file-lessc-idea-sh-LC3\" class=\"blob-code blob-code-inner js-file-line\">exploded_artifact_path=\/Users\/jude\/developer\/WizRocket\/out\/artifacts\/Dashboard_war_exploded<\/td>\n<\/tr>\n<tr>\n<td id=\"file-lessc-idea-sh-L4\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"4\"><\/td>\n<td id=\"file-lessc-idea-sh-LC4\" class=\"blob-code blob-code-inner js-file-line\">less=\/usr\/local\/bin\/lessc<\/td>\n<\/tr>\n<tr>\n<td id=\"file-lessc-idea-sh-L5\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"5\"><\/td>\n<td id=\"file-lessc-idea-sh-LC5\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-lessc-idea-sh-L6\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"6\"><\/td>\n<td id=\"file-lessc-idea-sh-LC6\" class=\"blob-code blob-code-inner js-file-line\">function update {<\/td>\n<\/tr>\n<tr>\n<td id=\"file-lessc-idea-sh-L7\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"7\"><\/td>\n<td id=\"file-lessc-idea-sh-LC7\" class=\"blob-code blob-code-inner js-file-line\">\ttarget=`echo $1 | sed s\/web\\\\\/\/ | sed s\/.less\/.css\/`<\/td>\n<\/tr>\n<tr>\n<td id=\"file-lessc-idea-sh-L8\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"8\"><\/td>\n<td id=\"file-lessc-idea-sh-LC8\" class=\"blob-code blob-code-inner js-file-line\">\techo &quot;Generating $exploded_artifact_path\/$target&quot;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-lessc-idea-sh-L9\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"9\"><\/td>\n<td id=\"file-lessc-idea-sh-LC9\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-lessc-idea-sh-L10\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"10\"><\/td>\n<td id=\"file-lessc-idea-sh-LC10\" class=\"blob-code blob-code-inner js-file-line\">\t$less $1 $exploded_artifact_path\/$target<\/td>\n<\/tr>\n<tr>\n<td id=\"file-lessc-idea-sh-L11\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"11\"><\/td>\n<td id=\"file-lessc-idea-sh-LC11\" class=\"blob-code blob-code-inner js-file-line\">}<\/td>\n<\/tr>\n<tr>\n<td id=\"file-lessc-idea-sh-L12\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"12\"><\/td>\n<td id=\"file-lessc-idea-sh-LC12\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-lessc-idea-sh-L13\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"13\"><\/td>\n<td id=\"file-lessc-idea-sh-LC13\" class=\"blob-code blob-code-inner js-file-line\">function all {<\/td>\n<\/tr>\n<tr>\n<td id=\"file-lessc-idea-sh-L14\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"14\"><\/td>\n<td id=\"file-lessc-idea-sh-LC14\" class=\"blob-code blob-code-inner js-file-line\">\tfind $exploded_artifact_path -name *.less | while read path; do<\/td>\n<\/tr>\n<tr>\n<td id=\"file-lessc-idea-sh-L15\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"15\"><\/td>\n<td id=\"file-lessc-idea-sh-LC15\" class=\"blob-code blob-code-inner js-file-line\">\t\toutput=`echo $path | sed s\/.less\/.css\/`<\/td>\n<\/tr>\n<tr>\n<td id=\"file-lessc-idea-sh-L16\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"16\"><\/td>\n<td id=\"file-lessc-idea-sh-LC16\" class=\"blob-code blob-code-inner js-file-line\">\t\techo &quot;Generating $output&quot;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-lessc-idea-sh-L17\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"17\"><\/td>\n<td id=\"file-lessc-idea-sh-LC17\" class=\"blob-code blob-code-inner js-file-line\">\t\t$less $path $output<\/td>\n<\/tr>\n<tr>\n<td id=\"file-lessc-idea-sh-L18\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"18\"><\/td>\n<td id=\"file-lessc-idea-sh-LC18\" class=\"blob-code blob-code-inner js-file-line\">\tdone<\/td>\n<\/tr>\n<tr>\n<td id=\"file-lessc-idea-sh-L19\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"19\"><\/td>\n<td id=\"file-lessc-idea-sh-LC19\" class=\"blob-code blob-code-inner js-file-line\">}<\/td>\n<\/tr>\n<tr>\n<td id=\"file-lessc-idea-sh-L20\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"20\"><\/td>\n<td id=\"file-lessc-idea-sh-LC20\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-lessc-idea-sh-L21\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"21\"><\/td>\n<td id=\"file-lessc-idea-sh-LC21\" class=\"blob-code blob-code-inner js-file-line\">$1 $2<\/td>\n<\/tr>\n<\/table>\n<\/div><\/div>\n<\/p><\/div>\n<\/div><\/div>\n<div class=\"gist-meta\">\n        <a href=\"https:\/\/gist.github.com\/judepereira\/99df70350156c54ff3fd\/raw\/f2096ae09f20653b0c1082cd3a9b06eae4aabe81\/lessc-idea.sh\" style=\"float:right\" class=\"Link--inTextBlock\">view raw<\/a><br \/>\n        <a href=\"https:\/\/gist.github.com\/judepereira\/99df70350156c54ff3fd#file-lessc-idea-sh\" class=\"Link--inTextBlock\"><br \/>\n          lessc-idea.sh<br \/>\n        <\/a><br \/>\n        hosted with &#10084; by <a class=\"Link--inTextBlock\" href=\"https:\/\/github.com\">GitHub<\/a>\n      <\/div>\n<\/p><\/div>\n<\/div>\n<p><strong>Note:<\/strong> You will need to update the variable\u00a0<em>exploded_artifact_path\u00a0<\/em>in the script above.<\/p>\n<p>Make it executable:<\/p>\n<p>$ chmod +x\u00a0\/Users\/username\/bin\/lessc-idea<\/p>\n<p>Now, open up your run configuration, and scroll all the way to the bottom (where it says Make, followed by Build artifact &#8230;). Hit the &#8220;+&#8221; button, and select &#8220;Run External Tool&#8221;.<\/p>\n<p>Hit the &#8220;+&#8221; button to add a new External Tool, and configure it as follows:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.32.45.png\" class=\"highslide-image\" onclick=\"return hs.expand(this);\" rel=\"attachment wp-att-1687\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1687\" data-permalink=\"https:\/\/judepereira.com\/blog\/compile-less-on-the-fly-for-your-exploded-war-in-intellij\/screen-shot-2016-02-05-at-01-32-45\/\" data-orig-file=\"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.32.45.png?fit=2028%2C978&amp;ssl=1\" data-orig-size=\"2028,978\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"External Tool configuration for compiling LESS files before deployment\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.32.45.png?fit=300%2C145&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.32.45.png?fit=1024%2C494&amp;ssl=1\" class=\"aligncenter size-large wp-image-1687\" src=\"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.32.45-1024x494.png?resize=620%2C299\" alt=\"External Tool configuration for compiling LESS files before deployment\" width=\"620\" height=\"299\" srcset=\"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.32.45.png?resize=1024%2C494&amp;ssl=1 1024w, https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.32.45.png?resize=150%2C72&amp;ssl=1 150w, https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.32.45.png?resize=300%2C145&amp;ssl=1 300w, https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.32.45.png?resize=768%2C370&amp;ssl=1 768w, https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.32.45.png?w=2028&amp;ssl=1 2028w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/a><\/p>\n<p>Ensure that the build order in your run configuration is as follows:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.38.55.png\" class=\"highslide-image\" onclick=\"return hs.expand(this);\" rel=\"attachment wp-att-1688\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1688\" data-permalink=\"https:\/\/judepereira.com\/blog\/compile-less-on-the-fly-for-your-exploded-war-in-intellij\/screen-shot-2016-02-05-at-01-38-55\/\" data-orig-file=\"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.38.55.png?fit=1956%2C280&amp;ssl=1\" data-orig-size=\"1956,280\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Build order for LESS compilation\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.38.55.png?fit=300%2C43&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.38.55.png?fit=1024%2C147&amp;ssl=1\" class=\"aligncenter size-large wp-image-1688\" src=\"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.38.55-1024x147.png?resize=620%2C89\" alt=\"Build order for LESS compilation\" width=\"620\" height=\"89\" srcset=\"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.38.55.png?resize=1024%2C147&amp;ssl=1 1024w, https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.38.55.png?resize=150%2C21&amp;ssl=1 150w, https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.38.55.png?resize=300%2C43&amp;ssl=1 300w, https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.38.55.png?resize=768%2C110&amp;ssl=1 768w, https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.38.55.png?w=1956&amp;ssl=1 1956w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/a><\/p>\n<p>Once this is done, your LESS files should be automatically generated when you deploy your web app. Go ahead and give it a shot.<\/p>\n<p>&nbsp;<\/p>\n<h2>Part 2: Configure the File Watcher plugin to re-compile LESS\u00a0files edited:<\/h2>\n<p>Go to Preferences, and navigate to File Watchers under Tools (left menu). Hit the &#8220;+&#8221; button and select &#8220;Less&#8221;.<\/p>\n<p>Configure your new watcher as shown in the screenshot below:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.45.30.png\" class=\"highslide-image\" onclick=\"return hs.expand(this);\" rel=\"attachment wp-att-1689\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1689\" data-permalink=\"https:\/\/judepereira.com\/blog\/compile-less-on-the-fly-for-your-exploded-war-in-intellij\/screen-shot-2016-02-05-at-01-45-30\/\" data-orig-file=\"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.45.30.png?fit=2464%2C1422&amp;ssl=1\" data-orig-size=\"2464,1422\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"File Watcher configuration for LESS files\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.45.30.png?fit=300%2C173&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.45.30.png?fit=1024%2C591&amp;ssl=1\" class=\"aligncenter size-large wp-image-1689\" src=\"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.45.30-1024x591.png?resize=620%2C358\" alt=\"File Watcher configuration for LESS files\" width=\"620\" height=\"358\" srcset=\"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.45.30.png?resize=1024%2C591&amp;ssl=1 1024w, https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.45.30.png?resize=150%2C87&amp;ssl=1 150w, https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.45.30.png?resize=300%2C173&amp;ssl=1 300w, https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.45.30.png?resize=768%2C443&amp;ssl=1 768w, https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.45.30.png?w=2000&amp;ssl=1 2000w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/a><\/p>\n<p>Before your hit the OK button, a few things to do:<\/p>\n<ol>\n<li>Clear any output filters added automatically: Press the Output Filters&#8230; button, and remove anything inside there.<\/li>\n<li>Select your scope: Select the CSS\/LESS directory within your web module (ensure you click on Include Recursively after you&#8217;ve selected the directory)<\/li>\n<\/ol>\n<p>You&#8217;re all set. Hit OK, then Apply, and OK.<\/p>\n<p>Test drive your new setup. The moment you change a LESS file, it&#8217;ll get re-compiled into the corresponding CSS file within the corresponding\u00a0directory in the artifact output, and you&#8217;ll be able to see the changes immediately.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>At CleverTap, we&#8217;ve recently started using LESS for dynamic CSS. While it has it&#8217;s upsides, the biggest downside\u00a0was that most of our developers couldn&#8217;t use the hot deploy feature for their local deployments. After an hour or so, we came up with a neat solution. &nbsp; There are two parts to this: Just before deploying [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[52],"tags":[557,563,564,561,562,560,559,558,41],"class_list":["post-1685","post","type-post","status-publish","format-standard","hentry","category-code","tag-compile","tag-css","tag-exploded","tag-file-watcher","tag-hot-deploy","tag-idea","tag-intellij","tag-less","tag-war"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pqtyx-rb","jetpack-related-posts":[{"id":1845,"url":"https:\/\/judepereira.com\/blog\/intellij-on-steroids-with-g1-gc\/","url_meta":{"origin":1685,"position":0},"title":"IntelliJ on steroids with G1 GC","author":"Jude Pereira","date":"June 15, 2018","format":false,"excerpt":"Lately, I noticed that IntelliJ started to pause for quite some time during it's GC cycles, and that it was very frequent when I was editing three files (over 1.2k LOC each) split vertically. The current version of IntelliJ runs on a bundled version of Java 1.8, who's default garbage\u2026","rel":"","context":"In &quot;another snippet | code&quot;","block_context":{"text":"another snippet | code","link":"https:\/\/judepereira.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":694,"url":"https:\/\/judepereira.com\/blog\/visual-basic-6-revisited-linux-wine\/","url_meta":{"origin":1685,"position":1},"title":"visual basic 6 revisited &#8211; linux &#8211; wine","author":"Jude Pereira","date":"August 5, 2010","format":false,"excerpt":"Earlier this year, I had written an article on running Visual Basic 6 on linux under wine, this is an update for it, the prior one is deprecated Getting Visual Basic 6 to work on linux is pretty easy, not much trouble, all the basic things work, as of what\u2026","rel":"","context":"In &quot;another snippet | code&quot;","block_context":{"text":"another snippet | code","link":"https:\/\/judepereira.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/posts\/1685","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/comments?post=1685"}],"version-history":[{"count":4,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/posts\/1685\/revisions"}],"predecessor-version":[{"id":1692,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/posts\/1685\/revisions\/1692"}],"wp:attachment":[{"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/media?parent=1685"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/categories?post=1685"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/tags?post=1685"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}