Skip to content

Commit 299a99b

Browse files
author
♥ David ♥
committed
Init
0 parents  commit 299a99b

File tree

4 files changed

+52
-0
lines changed

4 files changed

+52
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/node_modules/

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

index.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
var loaderUtils = require('loader-utils');
2+
var CleanCSS = require('clean-css');
3+
4+
5+
module.exports = function (css, map) {
6+
7+
var opti = this.options;
8+
var cleanCssOpti = opti.cleancss || opti['clean-css'] || opti.CleanCSS;
9+
10+
if ( typeof cleanCssOpti === "undefined" && cleanCssOpti === null ) {
11+
cleanCssOpti = {};
12+
}
13+
14+
new CleanCSS(cleanCssOpti).minify(css, function (err, minified) {
15+
if ( err ) { return callback(err);}
16+
// minified.styles
17+
return callback(null, minified.styles, minified.sourceMap);
18+
});
19+
20+
};

package.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "clean-css-loader",
3+
"version": "0.0.1",
4+
"description": "CleanCSS webpack loader",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "git+https://github.com/retyui/clean-css-loader.git"
12+
},
13+
"keywords": [
14+
"CleanCSS",
15+
"webpack",
16+
"webpack-loader",
17+
"loader",
18+
"clean-css-loader"
19+
],
20+
"author": "retyui",
21+
"license": "ISC",
22+
"bugs": {
23+
"url": "https://github.com/retyui/clean-css-loader/issues"
24+
},
25+
"homepage": "https://github.com/retyui/clean-css-loader#readme",
26+
"dependencies": {
27+
"clean-css": "^3.4.9",
28+
"loader-utils": "^0.2.12"
29+
}
30+
}

0 commit comments

Comments
 (0)