Skip to content
Browse files

initial publish

  • Loading branch information...
1 parent fbbb6db commit 6656e84b8322b099ba276016422d60336c1024e1 @geddski committed Oct 4, 2012
Showing with 139 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +1 −0 .npmignore
  3. +22 −0 LICENSE-MIT
  4. +41 −0 README.md
  5. +41 −0 package.json
  6. +33 −0 tasks/lessless.js
View
1 .gitignore
@@ -0,0 +1 @@
+node_modules
View
1 .npmignore
@@ -0,0 +1 @@
+/node_modules/
View
22 LICENSE-MIT
@@ -0,0 +1,22 @@
+Copyright (c) 2012 Dave Geddes
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
View
41 README.md
@@ -0,0 +1,41 @@
+# grunt-lessless
+
+Grunt plugin for [lessless](http://github.com/geddesign/lessless), a tool that compiles LESS into CSS, changes links to point to the CSS files, removes less.js from HTML page(s). Very handy when you're using less.js in the browser but want to deploy CSS.
+
+## Getting Started
+Install this grunt plugin next to your project's [Gruntfile][getting_started] with: `npm install grunt-lessless`
+
+Then add this line to your project's Gruntfile:
+
+```javascript
+grunt.loadNpmTasks('grunt-lessless');
+```
+
+[grunt]: https://github.com/cowboy/grunt
+[getting_started]: https://github.com/cowboy/grunt/blob/master/docs/getting_started.md
+
+## Documentation
+Add this to your Gruntfile.js:
+
+```js
+lessless: {
+ buildDir: 'path/to/frontend-build'
+}
+```
+If you're using RequireJS then `buildDir` should match `dir` from your requirejs settings. With grunt you can even point to the same variable:
+
+```js
+lessless: {
+ buildDir: '<%= requirejs.compile.options.dir %>'
+}
+```
+
+## Contributing
+In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [grunt][grunt].
+
+## Release History
+0.1.0 initial release.
+
+## License
+Copyright (c) 2012 Dave Geddes
+Licensed under the MIT license.
View
41 package.json
@@ -0,0 +1,41 @@
+{
+ "name": "grunt-lessless",
+ "description": "compile LESS into CSS, change links to point to the CSS files, remove less.js from page",
+ "version": "0.1.0",
+ "homepage": "https://github.com/geddesign/grunt-lessless",
+ "author": {
+ "name": "Dave Geddes",
+ "email": "davidcgeddes@gmail.com",
+ "url": "geddesign.com"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/geddesign/grunt-lessless"
+ },
+ "bugs": {
+ "url": "https://github.com/geddesign/grunt-lessless/issues"
+ },
+ "licenses": [
+ {
+ "type": "MIT",
+ "url": "https://github.com/geddesign/grunt-lessless/blob/master/LICENSE-MIT"
+ }
+ ],
+ "main": "Gruntfile.js",
+ "bin": "bin/grunt-lessless",
+ "engines": {
+ "node": ">= 0.6.0"
+ },
+ "scripts": {
+ "test": "grunt nodeunit"
+ },
+ "dependencies": {
+ "lessless" : "0.2.x"
+ },
+ "devDependencies": {
+ "grunt": "~0.4.0a"
+ },
+ "keywords": [
+ "gruntplugin"
+ ]
+}
View
33 tasks/lessless.js
@@ -0,0 +1,33 @@
+/*
+ * grunt-lessless
+ * https://github.com/geddesign/grunt-lessless
+ *
+ * Copyright (c) 2012 Dave Geddes
+ * Licensed under the MIT license.
+ */
+
+'use strict';
+var lessless = require('lessless');
+
+module.exports = function(grunt) {
+
+ grunt.registerTask('lessless', 'compile LESS into CSS via lessless', function() {
+ //log with grunt
+ lessless.setConsole({
+ log: function(msg){
+ grunt.log.oklns(msg);
+ }
+ });
+
+ //optimize the frontend-build output by requirejs
+ var done = this.async();
+ // lessless.optimizeProject(grunt.config.get("requirejs.compile.options.dir"));
+ lessless.optimizeProject(
+ grunt.config.get("lessless.buildDir"),
+ grunt.config.get('lessless.styledirs'),
+ grunt.config.get('lessless.stripExtensions')
+ );
+ done();
+ });
+
+};

0 comments on commit 6656e84

Please sign in to comment.
Something went wrong with that request. Please try again.