Skip to content

Commit

Permalink
feat: Use import/export to benefit from tree shaking
Browse files Browse the repository at this point in the history
  • Loading branch information
paultranvan committed Mar 8, 2021
1 parent fb15094 commit 1a72770
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions packages/cozy-flags/src/index.browser.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
/* global __ENABLED_FLAGS__ */

import flag from './flag'
import connect from './connect'
import FlagSwitcher from './FlagSwitcher'
import useFlag from './useFlag'

flag.connect = require('./connect').default
flag.FlagSwitcher = require('./FlagSwitcher').default
flag.useFlag = require('./useFlag').default
flag.connect = connect
flag.FlagSwitcher = FlagSwitcher
flag.useFlag = useFlag

if (typeof __ENABLED_FLAGS__ !== 'undefined') {
flag.enable(__ENABLED_FLAGS__)
}

module.exports = flag
export default flag
2 changes: 1 addition & 1 deletion packages/cozy-flags/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ if (typeof __ENABLED_FLAGS__ !== 'undefined') {
flag.enable(__ENABLED_FLAGS__)
}

module.exports = flag
export default flag

0 comments on commit 1a72770

Please sign in to comment.