File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,12 +29,6 @@ class ExtractPluginMissingException extends LoaderException {
2929
3030class InvalidRuntimeException extends LoaderException { }
3131
32- class SeveralRulesAppliedException extends LoaderException {
33- constructor ( resource , rules ) {
34- super ( `${ rules . length } rules applies to ${ resource } ` ) ;
35- }
36- }
37-
3832class RemainingLoadersInExtractModeException extends LoaderException {
3933 constructor ( ) {
4034 super ( `Some loaders will be applied after ${ PACKAGE_NAME } in extract mode` ) ;
@@ -45,5 +39,4 @@ exports.LoaderException = LoaderException;
4539exports . InvalidSvg = InvalidSvg ;
4640exports . ExtractPluginMissingException = ExtractPluginMissingException ;
4741exports . InvalidRuntimeException = InvalidRuntimeException ;
48- exports . SeveralRulesAppliedException = SeveralRulesAppliedException ;
4942exports . RemainingLoadersInExtractModeException = RemainingLoadersInExtractModeException ;
Original file line number Diff line number Diff line change @@ -26,10 +26,6 @@ module.exports = function loader(content) {
2626 const issuer = loaderContext . _module && loaderContext . _module . issuer ;
2727 const matchedRules = getMatchedRules ( resource , getLoadersRules ( compiler ) , issuer ) ;
2828
29- if ( matchedRules . length > 1 && ! compiler . isChild ( ) ) {
30- this . emitWarning ( new Exceptions . SeveralRulesAppliedException ( resource , matchedRules ) ) ;
31- }
32-
3329 if ( ! content . includes ( '<svg' ) ) {
3430 throw new Exceptions . InvalidSvg ( content , matchedRules ) ;
3531 }
Original file line number Diff line number Diff line change @@ -37,20 +37,6 @@ describe('loader and plugin', () => {
3737 errors . should . be . lengthOf ( 1 ) ;
3838 errors [ 0 ] . error . should . be . instanceOf ( Exceptions . InvalidRuntimeException ) ;
3939 } ) ;
40-
41- it ( 'should warn if several rules applied to module without issuer applied' , async ( ) => {
42- const { warnings } = await compileAndNotReject ( {
43- entry : './entry' ,
44- module : rules (
45- svgRule ( ) ,
46- rule ( { test : / \. s v g $ / , loader : loaderPath } )
47- )
48- } ) ;
49-
50- // TODO loader applies 2 times so warning also will me emitted 2 times
51- warnings . should . be . lengthOf ( 2 ) ;
52- warnings [ 0 ] . warning . should . be . instanceOf ( Exceptions . SeveralRulesAppliedException ) ;
53- } ) ;
5440 } ) ;
5541
5642 it ( 'should allow to use custom runtime generator' , async ( ) => {
@@ -65,21 +51,6 @@ describe('loader and plugin', () => {
6551
6652 assets [ 'main.js' ] . source ( ) . should . contain ( 'olala' ) ;
6753 } ) ;
68-
69- it ( 'should filter rules against issuer' , async ( ) => {
70- const { warnings } = await compileAndNotReject ( {
71- entry : './entry' ,
72- module : rules (
73- svgRule ( ) ,
74- rule ( { test : / \. s v g $ / , loader : loaderPath , issuer : / \. c s s $ / } )
75- )
76- } ) ;
77-
78- warnings . should . be . lengthOf ( isWebpack1 ? 2 : 0 ) ;
79- if ( isWebpack1 ) {
80- warnings [ 0 ] . warning . should . be . instanceOf ( Exceptions . SeveralRulesAppliedException ) ;
81- }
82- } ) ;
8354 } ) ;
8455
8556 describe ( 'extract mode' , ( ) => {
You can’t perform that action at this time.
0 commit comments