@@ -4,33 +4,8 @@ var MemoryFileSystem = require('memory-fs');
44var webpack = require ( 'webpack' ) ;
55var _ = require ( 'lodash' ) ;
66var ExtractTextPlugin = require ( 'extract-text-webpack-plugin' ) ;
7- var extractTextPluginMajorVersion = require ( 'extract-text-webpack-plugin/package.json' ) . version . split ( '.' ) [ 0 ] ;
87var plugin = require ( '../index.js' ) ;
98
10- // TODO: remove when dropping support for webpack@1
11- if ( Number ( extractTextPluginMajorVersion ) > 1 ) {
12- function FakeExtractTextPlugin ( fileName , opts ) {
13- ExtractTextPlugin . call ( this , _ . assign (
14- opts ,
15- {
16- filename : fileName
17- }
18- ) ) ;
19- }
20-
21- FakeExtractTextPlugin . prototype = Object . create ( ExtractTextPlugin . prototype ) ;
22- FakeExtractTextPlugin . prototype . constructor = FakeExtractTextPlugin ;
23-
24- FakeExtractTextPlugin . extract = function ( fallback , use ) {
25- return ExtractTextPlugin . extract ( {
26- fallback : fallback ,
27- use : use
28- } ) ;
29- } ;
30- } else {
31- FakeExtractTextPlugin = ExtractTextPlugin ;
32- }
33-
349var OUTPUT_DIR = path . join ( __dirname , './webpack-out' ) ;
3510var manifestPath = path . join ( OUTPUT_DIR , 'manifest.json' ) ;
3611
@@ -405,12 +380,16 @@ describe('ManifestPlugin', function() {
405380 module : {
406381 loaders : [ {
407382 test : / \. c s s $ / ,
408- loader : FakeExtractTextPlugin . extract ( 'style-loader' , 'css-loader' )
383+ loader : ExtractTextPlugin . extract ( {
384+ fallback : 'style-loader' ,
385+ use : 'css-loader'
386+ } )
409387 } ]
410388 } ,
411389 plugins : [
412390 new plugin ( ) ,
413- new FakeExtractTextPlugin ( '[name].css' , {
391+ new ExtractTextPlugin ( {
392+ filename : '[name].css' ,
414393 allChunks : true
415394 } )
416395 ]
0 commit comments