diff --git a/lib/build/stub-module.js b/lib/build/stub-module.js index 57ef46c5c..698019aff 100644 --- a/lib/build/stub-module.js +++ b/lib/build/stub-module.js @@ -27,7 +27,7 @@ const UNAVAIABLE_CORE_MODULES = [ 'tls' ]; -const EMPTY_MODULE = 'define(function(){});'; +const EMPTY_MODULE = 'define(function(){return {};});'; function resolvePath(packageName, root) { return path.relative(root, Utils.resolvePackagePath(packageName)).replace(/\\/g, '/'); diff --git a/spec/lib/build/stub-module.spec.js b/spec/lib/build/stub-module.spec.js index cc9ee0c2d..6dba460f0 100644 --- a/spec/lib/build/stub-module.spec.js +++ b/spec/lib/build/stub-module.spec.js @@ -48,10 +48,10 @@ describe('StubCoreNodejsModule', () => { }); it('stubs empty module for some core module', () => { - expect(stubModule('dns', 'src')).toBe('define(function(){});'); + expect(stubModule('dns', 'src')).toBe('define(function(){return {};});'); }); it('stubs empty module for __ignore__', () => { - expect(stubModule('__ignore__', 'src')).toBe('define(function(){});'); + expect(stubModule('__ignore__', 'src')).toBe('define(function(){return {};});'); }); });