File tree 2 files changed +4
-9
lines changed
2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change 1
1
var _ = require ( 'underscore' ) ;
2
+ var webpackSources = require ( 'webpack-sources' ) ;
2
3
3
4
function OptimizeCssAssetsPlugin ( options ) {
4
5
this . options = options || { } ;
@@ -31,14 +32,7 @@ OptimizeCssAssetsPlugin.prototype.processCss = function(css) {
31
32
} ;
32
33
33
34
OptimizeCssAssetsPlugin . prototype . createCssAsset = function ( css , originalAsset ) {
34
- return {
35
- source : function ( ) {
36
- return css ;
37
- } ,
38
- size : function ( ) {
39
- return css . length ;
40
- }
41
- } ;
35
+ return new webpackSources . RawSource ( css ) ;
42
36
} ;
43
37
44
38
OptimizeCssAssetsPlugin . prototype . apply = function ( compiler ) {
Original file line number Diff line number Diff line change 5
5
"description" : " A Webpack plugin to optimize \\ minimize CSS assets." ,
6
6
"dependencies" : {
7
7
"cssnano" : " ^3.4.0" ,
8
- "underscore" : " ^1.8.3"
8
+ "underscore" : " ^1.8.3" ,
9
+ "webpack-sources" : " ^0.1.0"
9
10
},
10
11
"main" : " index.js" ,
11
12
"homepage" : " http://github.com/NMFR/optimize-css-assets-webpack-plugin" ,
You can’t perform that action at this time.
0 commit comments