Commit bbc0445
Add ESM-first dual module support
This change adds full ES Module support while maintaining backward
compatibility with CommonJS.
Key Changes:
- Package is now "type": "module" with ESM as primary format
- Dual compilation: ESM (dist/esm/) and CJS (dist/cjs/)
- Package.json exports map for conditional resolution
- Updated all imports to include .js extensions for ESM compatibility
Module Support:
- ESM: import gocardless from 'gocardless-nodejs'
- CJS: const gocardless = require('gocardless-nodejs')
- Subpath exports: import { parse } from 'gocardless-nodejs/webhooks'
- TypeScript types for both formats
- Tree-shaking support for modern bundlers
Build Output:
- dist/esm/ - ES Modules (primary)
- dist/cjs/ - CommonJS (compatibility layer)
- dist/types/ - Shared TypeScript definitions
Fixes #124
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent e67da94 commit bbc0445
371 files changed
Lines changed: 14647 additions & 275 deletions
File tree
- dist
- cjs
- api
- services
- types
- esm
- api
- services
- types
- types
- api
- services
- types
- src
- api
- services
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | 23 | | |
25 | | - | |
26 | | - | |
27 | | - | |
| 24 | + | |
| 25 | + | |
28 | 26 | | |
29 | | - | |
| 27 | + | |
30 | 28 | | |
31 | 29 | | |
32 | | - | |
33 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
34 | 45 | | |
| 46 | + | |
| 47 | + | |
35 | 48 | | |
36 | 49 | | |
37 | 50 | | |
| |||
42 | 55 | | |
43 | 56 | | |
44 | 57 | | |
45 | | - | |
| 58 | + | |
46 | 59 | | |
47 | 60 | | |
48 | 61 | | |
| |||
86 | 99 | | |
87 | 100 | | |
88 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments