From 3e58994fa7d5206e6c220bea12c43649cd29de7d Mon Sep 17 00:00:00 2001 From: Rasmus Eneman Date: Fri, 31 Aug 2018 20:09:25 +0200 Subject: [PATCH] Import lodash/flowRight using ES import to allow for treeshaking --- src/browser.ts | 3 +-- typings/lodash_flow-right.ts | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 typings/lodash_flow-right.ts diff --git a/src/browser.ts b/src/browser.ts index 48a268fbb8..bc3df48ca9 100644 --- a/src/browser.ts +++ b/src/browser.ts @@ -24,5 +24,4 @@ export * from './withApollo' export * from './types'; // XXX remove in the next breaking semver change (3.0) -const compose = require('lodash/flowRight'); -export { compose }; +export { default as compose } from 'lodash/flowRight'; diff --git a/typings/lodash_flow-right.ts b/typings/lodash_flow-right.ts new file mode 100644 index 0000000000..c8a85efd37 --- /dev/null +++ b/typings/lodash_flow-right.ts @@ -0,0 +1,5 @@ +declare module 'lodash/flowRight' { + import { flowRight } from 'lodash'; + + export default flowRight; +}