File tree Expand file tree Collapse file tree 4 files changed +52
-0
lines changed
Expand file tree Collapse file tree 4 files changed +52
-0
lines changed Original file line number Diff line number Diff line change 1+ /node_modules /
Original file line number Diff line number Diff line change 1+ �
Original file line number Diff line number Diff line change 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+ } ;
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments