Skip to content

Commit 3fecdca

Browse files
shesekjgriffiths
authored andcommitted
wasm: Make all named exports available via the default export
With this, its possible to use the more idiomatic `import wally from 'wallycore'`, rather than `import * as wally from 'wallycore'`. The `* as` style is still supported.
1 parent a116f5b commit 3fecdca

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

src/wasm_package/exports.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export * from './core.js'
2+
export * from './const.js'
3+
export * from './functions.js'

src/wasm_package/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
export * from './core.js'
2-
export * from './const.js'
3-
export * from './functions.js'
1+
// Combining functions.js + const.js + core.js as the default export requires a separate
2+
// exports.js file that unifies them as named exports.
3+
// With this, library users can `import wally from 'wallycore'`, without `* as`
4+
5+
export * from './exports.js'
6+
export * as default from './exports.js'

0 commit comments

Comments
 (0)