From ba6a78064effbf57e2d230988ebded830370ed34 Mon Sep 17 00:00:00 2001 From: David Luecke Date: Tue, 14 Nov 2017 10:00:11 -0800 Subject: [PATCH 1/2] Add default export for better ES module (TypeScript) compatibility --- lib/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/index.js b/lib/index.js index 4b4719a16f..17897f8ee7 100644 --- a/lib/index.js +++ b/lib/index.js @@ -16,3 +16,6 @@ function createApplication () { createApplication.version = version; module.exports = createApplication; + +// For better ES module (TypeScript) compatibility +module.exports.default = createApplication; From b216eaf7d16deb72e324b4fd2936977bc43111dd Mon Sep 17 00:00:00 2001 From: David Luecke Date: Tue, 14 Nov 2017 17:57:41 -0800 Subject: [PATCH 2/2] Add test for default export --- test/application.test.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/application.test.js b/test/application.test.js index e37b304642..5a9cf66dc5 100644 --- a/test/application.test.js +++ b/test/application.test.js @@ -3,6 +3,10 @@ const Proto = require('uberproto'); const feathers = require('../lib'); describe('Feathers application', () => { + it('adds an ES module `default` export', () => { + assert.equal(feathers, feathers.default); + }); + it('initializes', () => { const app = feathers();