Skip to content

Commit

Permalink
build(connect-plugin-ethereum): build for esm
Browse files Browse the repository at this point in the history
  • Loading branch information
karliatto committed Jan 31, 2025
1 parent 0ecb062 commit 5578d9c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/connect-plugin-ethereum/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,14 @@
},
"main": "src/index.ts",
"files": [
"lib/"
"lib/",
"libESM",
"!**/*.map"
],
"exports": {
"node": "./lib/index.js",
"default": "./libESM/index.js"
},
"peerDependencies": {
"@metamask/eth-sig-util": "^8.0.0",
"tslib": "^2.6.2"
Expand All @@ -35,6 +41,8 @@
"scripts": {
"test:unit": "yarn g:jest -c ../../jest.config.base.js",
"type-check": "yarn g:tsc --build tsconfig.json",
"build:lib": "yarn g:rimraf ./lib && yarn g:tsc --build tsconfig.lib.json && ../../scripts/replace-imports.sh ./lib"
"build:lib": "yarn build:lib:cjs && yarn build:lib:esm",
"build:lib:cjs": "yarn g:rimraf ./lib && yarn g:tsc --build tsconfig.lib.json && ../../scripts/replace-imports.sh ./lib",
"build:lib:esm": "yarn g:rimraf ./libESM && yarn g:tsc --build tsconfig.libESM.json && ../../scripts/replace-imports.sh ./libESM libESM"
}
}
8 changes: 8 additions & 0 deletions packages/connect-plugin-ethereum/tsconfig.libESM.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.lib.json",
"compilerOptions": {
"outDir": "libESM",
"module": "ESNext",
"target": "esnext"
}
}

0 comments on commit 5578d9c

Please sign in to comment.