AirDrop for flatiron
AirDrop is a Node.js Connect middleware for compiling, concatenating and minimizing your JS/Coffee source files and delivering them to the browser on-the-fly.
Personally I think this approach is preferable to using build scripts, file watchers, etc.
Now it's for flatiron too.
Install
Install with npm
:
npm install air-drop-flatiron
You can run the specs with npm
as well:
API
See AirDrop repo
Flatiron integration
var flatiron = app = flatironapp AirDrop = ecstatic = package = // .package().minimize().cache(); app; //app is now AirDrop aware (app.AirDrop('foo-pack').include...)//you can defined AirDrop packages before app.use(flatiron.plugins.http) or afterapp; //When a package is created AirDrop set automatically routes to Director for handling this package app;
Current issues
Windows
Currently, AirDrop is not working on windows because of path resolving (nightmare on windows: path c:/foo/bar
is resolved as c:\\foo\\bar
) and it makes bad things on Path AirDrop module.
Second issue on windows is usage of glob.
glob wants input with forward-slach (accept /foo/bar
and not \\foo\\bar
). Still path resolution in AirDrop has to fix path before using glob.
I sent a pull request to AirDrop to fix these issues.
Last, but not the least, glob is not working with windows absolute path (eg: glob('c:/foo/bar')
).
I sent a pull request to glob to fix these issues.
AirDrop
AirDrop accept required module to be named:
// in your Node scriptvar package = ; // in the browservar _ = ;
But this currently only work if you use .package()
otherwise option {name: "foo"}
is not used.
I sent a pull request to fix this issue and make it working with air-drop-flatiron.