File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,10 @@ module.exports = function nodeExternals(options) {
3030 utils . log ( mistake . message ) ;
3131 } ) ;
3232 }
33- const allowlist = [ ] . concat ( options . allowlist || [ ] ) ;
33+ const webpackInternalAllowlist = [ / ^ w e b p a c k \/ c o n t a i n e r \/ r e f e r e n c e \/ / ] ;
34+ const allowlist = [ ]
35+ . concat ( webpackInternalAllowlist )
36+ . concat ( options . allowlist || [ ] ) ;
3437 const binaryDirs = [ ] . concat ( options . binaryDirs || [ '.bin' ] ) ;
3538 const importType = options . importType || 'commonjs' ;
3639 const modulesDir = options . modulesDir || 'node_modules' ;
Original file line number Diff line number Diff line change @@ -180,6 +180,11 @@ describe('respects an allowlist', function() {
180180 it ( 'when given a relative path' , assertResult ( './src/index.js' , undefined ) ) ;
181181 } ) ;
182182
183+ describe ( 'should respect webpack 5 internal allowlist' , function ( ) {
184+ it ( 'should ignore the specific path (empty callback)' , assertResult ( 'webpack/container/reference/' , undefined ) ) ;
185+ it ( 'should invoke a commonjs callback' , assertResult ( 'moduleB' , 'commonjs moduleB' ) ) ;
186+ } ) ;
187+
183188 after ( function ( ) {
184189 restoreMock ( )
185190 } ) ;
You can’t perform that action at this time.
0 commit comments