Skip to content

Instantly share code, notes, and snippets.

View itsjustcon's full-sized avatar

Connor itsjustcon

  • Shopify
  • Atlanta, GA
  • 04:13 (UTC -04:00)
View GitHub Profile
@itsjustcon
itsjustcon / LESScompiler.js
Last active May 1, 2021 06:28
Uses Node.js to compile LESS files (on file change) into compressed css automatically! This simple script has saved me hours of compile & versioning mistakes by compiling everything automatically per-file! 1. Drop LESScompiler.js and struct.json into a folder with all your LESS files 2. Modify struct.json to fit your file names & output location…
var less = require('less'),
fs = require('fs'),
path = require('path'),
struct = path.join(__dirname,'struct.json'),
files = {};
// Watch current folder & compile if file from files{} has changed
fs.watch(__dirname,function (evt, file) {
file = path.relative(__dirname,file);
if ( !file || !files[file] ) return;