@@ -28,15 +28,14 @@ ExtractTextPlugin.loader = function(options) {
28
28
ExtractTextPlugin . extract = function ( before , loader ) {
29
29
if ( loader ) {
30
30
return [
31
- ExtractTextPlugin . loader ( { remove : true , extract : false } ) ,
31
+ ExtractTextPlugin . loader ( { omit : before . split ( "!" ) . length , extract : true , remove : true } ) ,
32
32
before ,
33
- ExtractTextPlugin . loader ( ) ,
34
33
loader
35
34
] . join ( "!" ) ;
36
35
} else {
37
36
loader = before ;
38
37
return [
39
- ExtractTextPlugin . loader ( ) ,
38
+ ExtractTextPlugin . loader ( { remove : true } ) ,
40
39
loader
41
40
] . join ( "!" ) ;
42
41
}
@@ -51,23 +50,22 @@ ExtractTextPlugin.prototype.loader = function(options) {
51
50
ExtractTextPlugin . prototype . extract = function ( before , loader ) {
52
51
if ( loader ) {
53
52
return [
54
- this . loader ( { remove : true , extract : false } ) ,
53
+ this . loader ( { move : before . split ( "!" ) . length , extract : true , remove : true } ) ,
55
54
before ,
56
- this . loader ( ) ,
57
55
loader
58
56
] . join ( "!" ) ;
59
57
} else {
60
58
loader = before ;
61
59
return [
62
- this . loader ( ) ,
60
+ this . loader ( { remove : true } ) ,
63
61
loader
64
62
] . join ( "!" ) ;
65
63
}
66
64
} ;
67
65
68
66
ExtractTextPlugin . prototype . apply = function ( compiler ) {
69
67
var options = this . options ;
70
- compiler . plugin ( "compilation" , function ( compilation ) {
68
+ compiler . plugin ( "this- compilation" , function ( compilation ) {
71
69
compilation . plugin ( "normal-module-loader" , function ( loaderContext , module ) {
72
70
loaderContext [ __dirname ] = function ( text , opt ) {
73
71
if ( typeof text !== "string" && text !== null )
@@ -99,7 +97,9 @@ ExtractTextPlugin.prototype.apply = function(compiler) {
99
97
}
100
98
meta = module . meta [ __dirname ] ;
101
99
if ( typeof meta . text !== "string" ) {
102
- return callback ( new Error ( module . identifier ( ) + " doesn't export text" ) ) ;
100
+ var err = new Error ( module . identifier ( ) + " doesn't export text" ) ;
101
+ compilation . errors . push ( err ) ;
102
+ return callback ( ) ;
103
103
}
104
104
text . push ( meta . text ) ;
105
105
callback ( ) ;
0 commit comments