File tree Expand file tree Collapse file tree
test/configCases/node/filename-and-dirname Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -190,6 +190,16 @@ class NodeStuffPlugin {
190190 ) {
191191 hooks . propertyInDestructuring . tap ( PLUGIN_NAME , ( usingProperty ) => {
192192 if ( property === usingProperty . id ) {
193+ if ( warning ) {
194+ parser . state . module . addWarning (
195+ new NodeStuffInWebError (
196+ usingProperty . loc ,
197+ expressionName ,
198+ warning
199+ )
200+ ) ;
201+ }
202+
193203 return `${ property } : ${ JSON . stringify ( fn ( parser . state . module ) ) } ,` ;
194204 }
195205 } ) ;
Original file line number Diff line number Diff line change @@ -5,12 +5,18 @@ module.exports = [
55 / " _ _ f i l e n a m e " h a s b e e n u s e d / ,
66 / " i m p o r t .m e t a .d i r n a m e " h a s b e e n u s e d / ,
77 / " i m p o r t .m e t a .f i l e n a m e " h a s b e e n u s e d / ,
8+ / " i m p o r t .m e t a .d i r n a m e " h a s b e e n u s e d / ,
9+ / " i m p o r t .m e t a .f i l e n a m e " h a s b e e n u s e d / ,
810 / " _ _ d i r n a m e " h a s b e e n u s e d / ,
911 / " _ _ f i l e n a m e " h a s b e e n u s e d / ,
1012 / " i m p o r t .m e t a .d i r n a m e " h a s b e e n u s e d / ,
1113 / " i m p o r t .m e t a .f i l e n a m e " h a s b e e n u s e d / ,
14+ / " i m p o r t .m e t a .d i r n a m e " h a s b e e n u s e d / ,
15+ / " i m p o r t .m e t a .f i l e n a m e " h a s b e e n u s e d / ,
1216 / " _ _ d i r n a m e " h a s b e e n u s e d / ,
1317 / " _ _ f i l e n a m e " h a s b e e n u s e d / ,
1418 / " i m p o r t .m e t a .d i r n a m e " h a s b e e n u s e d / ,
19+ / " i m p o r t .m e t a .f i l e n a m e " h a s b e e n u s e d / ,
20+ / " i m p o r t .m e t a .d i r n a m e " h a s b e e n u s e d / ,
1521 / " i m p o r t .m e t a .f i l e n a m e " h a s b e e n u s e d /
1622] ;
You can’t perform that action at this time.
0 commit comments