Skip to content

Commit

Permalink
initial version
Browse files Browse the repository at this point in the history
  • Loading branch information
yomed committed Jul 18, 2015
1 parent fe00ee0 commit 7ad9a96
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.idea/
node_modules/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# lasso-clean-css

This is a plugin for Lasso which can be used to minify CSS using clean-css.
Plugin for [Lasso.js](https://github.com/lasso-js/lasso) that adds support for minifying CSS using [clean-css](https://github.com/jakubpawlowicz/clean-css).
19 changes: 19 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
var CleanCSS = require('clean-css');

function minify(src, options) {
if (!options) {
options = {};
}
return new CleanCSS(options).minify(src).styles;
}

exports = module.exports = function (lasso, config) {
lasso.addTransform({
contentType: 'css',
name: module.id,
stream: false,
transform: function (code) {
return minify(code, config);
}
});
};
16 changes: 13 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
{
"name": "lasso-clean-css",
"version": "0.0.1",
"description": "Lasso plugin to minify CSS using clean-css",
"keywords": ["lasso", "plugin", "minify", "minifier", "clean-css"],
"description": "Lasso.js plugin to minify CSS using clean-css",
"keywords": [
"lasso",
"plugin",
"minify",
"minifier",
"css",
"clean-css"
],
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Expand All @@ -15,5 +22,8 @@
"name": "Yoni Medoff",
"email": "[email protected]"
},
"license": "ISC"
"license": "ISC",
"dependencies": {
"clean-css": "^3.3.6"
}
}

0 comments on commit 7ad9a96

Please sign in to comment.