Use your LESS files in Browserify with this Node module
At TIME, where I have been since August, we place interactives in pages using a WordPress short code that places an empty
<div>: the markup, style and code.
I like this strategy because it keeps each project self contained outside the CMS while still running directly in the article page instead of in dreaded iframes. I use browserify to write everything in Node, using
require() to pull in scripts as needed and bundle them into one file. It's an enormously satisfying way to compose.
For HTML, there's already a useful module called node-underscorify, which allows one to include Underscore templates. Which that module as a model, I just published a node-lessify package that allows one to require LESS or CSS (which is, of course, merely a subset of LESS).
npm install node-lessify
browserify -t node-lessify script.js > bundle.js
Fixes and questions welcome at the repo, as always.