Skip to content

Commit

Permalink
Merge pull request #113 from uladsemenik/commonjs
Browse files Browse the repository at this point in the history
feat: cjs build
  • Loading branch information
icaldana authored Dec 17, 2024
2 parents 3494de4 + a976353 commit 0392c6c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"name": "@mercadopago/sdk-react",
"version": "0.0.19",
"description": "Mercado Pago SDK React",
"main": "index.js",
"main": "cjs/index.js",
"module": "esm/index.js",
"types": "esm/index.d.ts",
"keywords": [
"React",
"MarcadoPago",
Expand All @@ -11,7 +13,9 @@
],
"scripts": {
"start": "npm run build && storybook dev -p 6006",
"build": "rm -rf ./dist && tsc -b ./tsconfig.prod.json && cp package.json ./dist && cp LICENSE ./dist && cp README.md ./dist",
"build": "rm -rf ./dist && npm run build:esm && npm run build:cjs && cp package.json ./dist && cp LICENSE ./dist && cp README.md ./dist",
"build:esm": "tsc -b ./tsconfig.prod.json",
"build:cjs": "tsc -b ./tsconfig.prod-cjs.json",
"test": "jest --c ./jest.config.ts"
},
"repository": {
Expand Down
8 changes: 8 additions & 0 deletions tsconfig.prod-cjs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.prod.json",
"compilerOptions": {
"outDir": "./dist/cjs",
"module": "CommonJS",
"declaration": false
}
}
3 changes: 2 additions & 1 deletion tsconfig.prod.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
],
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "./src"
"rootDir": "./src",
"outDir": "./dist/esm"
}
}

0 comments on commit 0392c6c

Please sign in to comment.