Skip to content

Commit 5447881

Browse files
authored
Added cjs for utils (#260) (#261)
* Added cjs for utils * Added cjs for utility functions * Update build commands
2 parents d78568f + 7b562b2 commit 5447881

File tree

5 files changed

+25
-10
lines changed

5 files changed

+25
-10
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [[0.1.1](https://github.com/multiversx/mx-sdk-dapp-ui/pull/261)] - 2025-11-03
11+
12+
- [Added cjs for utility functions](https://github.com/multiversx/mx-sdk-dapp-ui/pull/260)
1013

1114
## [[0.1.0](https://github.com/multiversx/mx-sdk-dapp-ui/pull/256)] - 2025-10-29
1215

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@multiversx/sdk-dapp-ui",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "A library to hold UI components for a dApp on the MultiversX blockchain",
55
"author": "MultiversX",
66
"license": "MIT",
@@ -16,10 +16,12 @@
1616
},
1717
"./utils/getDetectedBrowser": {
1818
"import": "./dist/utils/utils/getDetectedBrowser.js",
19+
"require": "./dist/cjs/utils/getDetectedBrowser.js",
1920
"types": "./dist/types/utils/getDetectedBrowser.d.ts"
2021
},
2122
"./utils/constants/browser.enum": {
2223
"import": "./dist/utils/constants/browser.enum.js",
24+
"require": "./dist/cjs/constants/browser.enum.js",
2325
"types": "./dist/types/constants/browser.enum.d.ts"
2426
},
2527
"./mvx-unlock-panel": {
@@ -82,7 +84,9 @@
8284
"test.watch": "stencil test --spec --e2e --watchAll",
8385
"generate": "stencil generate",
8486
"build:dev": "stencil build --dev",
85-
"build": "stencil build --prod && tsc -p tsconfig.utils.json && tsc-alias -p tsconfig.utils.json",
87+
"build:esm:utils": "tsc -p tsconfig.utils.esm.json && tsc-alias -p tsconfig.utils.esm.json",
88+
"build:cjs:utils": "tsc -p tsconfig.utils.cjs.json && tsc-alias -p tsconfig.utils.cjs.json",
89+
"build": "stencil build --prod && npm run build:esm:utils && npm run build:cjs:utils",
8690
"start": "yarn run build:dev --watch --serve",
8791
"storybook-build-tailwind": "npx ts-node .storybook/generate-safelist.ts && npx @tailwindcss/cli -i src/global/tailwind.css -o .storybook/tailwind.css --content '.storybook/tailwind-safelist.html' && rm -f .storybook/tailwind-safelist.html",
8892
"storybook-dev": "yarn run build && yarn run storybook-build-tailwind && storybook dev -p 6006 --no-open",

tsconfig.utils.cjs.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "./tsconfig.utils.json",
3+
"compilerOptions": {
4+
"module": "CommonJS",
5+
"outDir": "dist/cjs"
6+
}
7+
}

tsconfig.utils.esm.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "./tsconfig.utils.json",
3+
"compilerOptions": {
4+
"module": "ES2020",
5+
"outDir": "dist/utils"
6+
}
7+
}

tsconfig.utils.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
44
"target": "ES2020",
5-
"module": "ES2020",
65
"moduleResolution": "Node",
76
"rootDir": "src",
8-
"outDir": "dist/utils",
97
"declaration": false,
108
"sourceMap": false,
119
"skipLibCheck": true,
@@ -17,9 +15,5 @@
1715
"constants/*": ["constants/*"]
1816
}
1917
},
20-
"include": [
21-
"src/utils/getDetectedBrowser.ts",
22-
"src/constants/browser.enum.ts",
23-
"src/constants/window.constants.ts"
24-
]
25-
}
18+
"include": ["src/utils/getDetectedBrowser.ts", "src/constants/browser.enum.ts", "src/constants/window.constants.ts"]
19+
}

0 commit comments

Comments
 (0)