diff --git a/index.js b/index.js new file mode 100644 index 000000000000..05fb3957c28e --- /dev/null +++ b/index.js @@ -0,0 +1,39 @@ +var compiled = null; + +module.exports = function(opts, cb) { + if (typeof opts == 'function') { + cb = opts; + opts = {}; + } + + var path = require('path'), + recess = require('recess'), + bootstrapSrc = path.resolve(__dirname + '/less/bootstrap.less'), + responsiveSrc = path.resolve(__dirname + '/less/responsive.less'); + + if (compiled) { + return cb(null, compiled); + } + + recess(bootstrapSrc, {compile: true}, function(err, obj) { + if (err) { + return cb(err); + } + + compiled = obj.output; + + if (opts.responsive) { + recess(responsiveSrc, {compile: true}, function(err, obj) { + if (err) { + return cb(err); + } + + compiled += obj.output; + + cb(null, compiled); + }); + } else { + cb(null, compiled); + } + }); +}; diff --git a/package.json b/package.json index 1e85f927bd93..f4744cec5f3b 100644 --- a/package.json +++ b/package.json @@ -1,25 +1,39 @@ { - "name": "bootstrap" - , "description": "Sleek, intuitive, and powerful front-end framework for faster and easier web development." - , "version": "2.1.0" - , "keywords": ["bootstrap", "css"] - , "homepage": "http://twitter.github.com/bootstrap/" - , "author": "Twitter Inc." - , "scripts": { "test": "make test" } - , "repository": { - "type": "git" - , "url": "https://github.com/twitter/bootstrap.git" - } - , "licenses": [ + "name": "die-bootstrap", + "description": "Sleek, intuitive, and powerful front-end framework for faster and easier web development.", + "version": "2.1.0", + "keywords": [ + "bootstrap", + "css", + "die" + ], + "homepage": "https://github.com/zeekay/die-bootstrap", + "author": { + "name": "Zach Kelling", + "email": "zeekayy@gmail.com", + "url": "http://whatit.is" + }, + "main": "index.js", + "scripts": { + "test": "make test" + }, + "repository": { + "type": "git", + "url": "https://github.com/zeekay/die-bootstrap" + }, + "licenses": [ { - "type": "Apache-2.0" - , "url": "http://www.apache.org/licenses/LICENSE-2.0" + "type": "Apache-2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0" } - ] - , "devDependencies": { - "uglify-js": "1.2.6" - , "jshint": "0.6.1" - , "recess": "1.0.3" - , "connect": "2.1.3" + ], + "devDependencies": { + "uglify-js": "1.2.6", + "jshint": "0.6.1", + "recess": "1.0.3", + "connect": "2.1.3" + }, + "dependencies": { + "recess": "~1.1.6" } -} \ No newline at end of file +}