optimalbits / cabinet Goto Github PK
View Code? Open in Web Editor NEWA lightweight fast static file server for node loaded with useful features
A lightweight fast static file server for node loaded with useful features
There should be an option to disable logging; I don't need my logfiles littered with statements like:
debug: cache hit:/path/to/file.js
This should be trivial, except for how to handle the use of data in the template. This might be achievable by using a "virtual" to process the template with data.
It would be great if Cabinet had a filter for minifying plain-old CSS files. The LESS parser can do this if you feed it a CSS file and pass compress:true to the tree.toCSS method.
I'd be happy to contribute such a filter if that's something you'd be interested in including. Would it make more sense as a separate CSS filter, or as an add-on to the existing LESS filter? If it's the former, I'd also modify the LESS filter to accept a compress option for compressing the compiled CSS output.
Another simple question/issue. I've noticed that you can minify javascript with the minjs
parameter, but CSS is minification seems to be excluded. Is this by design, or has it merely not yet been implemented?
After taking a look at the readme and code it seems that this requires the use of a virtual to concatenate assets. Is this true? If so, will a concatenation virtual be added to this?
app.use(cabinet(
home + '/public',
{
gzip : true,
minjs : true,
maxAge : 60 * 60,
cache : { maxSize : 1024 * 50, maxObjects : 512 },
less : { paths : [ '.', home + '/public/css' ], compress : true }
}
));
$> curl http://localhost:3000/js/controllers/home.js
TypeError: Cannot call method 'match' of undefined
at Function.filters.gzip.check (node_modules/cabinet/lib/filter.js:57:38)
at applyFilter (node_modules/cabinet/lib/filter.js:155:13)
at node_modules/cabinet/lib/filter.js:168:13
at filters.minjs (node_modules/cabinet/lib/filter.js:137:5)
at node_modules/cabinet/lib/filter.js:166:9
at fs.readFile (fs.js:176:14)
at Object.oncomplete (fs.js:297:15)
While writing a virtual of my own, I noticed that it was not recompiling when its component files were modified. I quickly checked this out using cabinet.virtuals.manifest
, which also failed to recompile on change.
My first suspicion is that this is happening because I'm running this on Windows, which might have some inconsistent watch behaviors.
The title says it all really.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.