Skip to content

Commit c2949d4

Browse files
authored
export Analytics as both a named export and a default export (#677)
1 parent 05eb53e commit c2949d4

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { default as AnalyticsDefaultImport } from '@segment/analytics-node'
2+
import { Analytics as AnalyticsNamedImport } from '@segment/analytics-node'
3+
4+
{
5+
// test named imports vs default imports
6+
new AnalyticsNamedImport({ writeKey: 'hello world' })
7+
new AnalyticsDefaultImport({ writeKey: 'hello world' })
8+
}

packages/node/src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
export * from './app/analytics-node'
22
export type { AnalyticsSettings } from './app/settings'
3+
4+
// export Analytics as both a named export and a default export (for backwards-compat. reasons)
5+
import { Analytics } from './app/analytics-node'
6+
export default Analytics

0 commit comments

Comments
 (0)