Skip to content

Commit b63fe3a

Browse files
authored
Fix browser compatibility with proper module resolution and UMD configuration. (#798)
* Update browser library configuration to UMD format in webpack.config.browser.js * Remove crypto-browserify
1 parent 66f824e commit b63fe3a

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Fixed
66
* Remove `MuxedAccount.parseBaseAddress` from TypeScript definitions ([#797](https://github.com/stellar/js-stellar-base/pull/797)).
7+
* Fix browser compatibility with proper module resolution and UMD configuration ([#798](https://github.com/stellar/js-stellar-base/pull/798)).
78

89
## [`v13.1.0`](https://github.com/stellar/js-stellar-base/compare/v13.0.1...v13.1.0)
910

config/webpack.config.browser.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ const config = {
2121
},
2222
output: {
2323
clean: true,
24-
library: 'StellarBase',
24+
library: {
25+
name: 'StellarBase',
26+
type: 'umd',
27+
umdNamedDefine: true
28+
},
2529
path: path.resolve(__dirname, '../dist')
2630
},
2731
mode: process.env.NODE_ENV ?? 'development',
@@ -30,7 +34,7 @@ const config = {
3034
rules: [
3135
{
3236
test: /\.m?js$/,
33-
exclude: /node_modules/,
37+
exclude: /node_modules\/(?!(js-xdr))/,
3438
use: {
3539
loader: 'babel-loader',
3640
options: {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Low-level support library for the Stellar network.",
55
"main": "./lib/index.js",
66
"browser": {
7-
"main": "./dist/stellar-base.min.js",
7+
"./lib/index.js": "./dist/stellar-base.min.js",
88
"sodium-native": false
99
},
1010
"types": "./types/index.d.ts",

0 commit comments

Comments
 (0)