Skip to content

Commit

Permalink
added multi format building
Browse files Browse the repository at this point in the history
  • Loading branch information
DKotsyuba committed Jun 28, 2024
1 parent 517af9d commit 7c5b37f
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 23 deletions.
20 changes: 15 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,18 @@
"license": "MIT",
"private": false,
"exports": {
".": "./dist/index.js",
"./axios": "./dist/axios-ext.js"
".": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js"
},
"./axios": {
"import": "./dist/esm/axios-ext.js",
"require": "./dist/cjs/axios-ext.js"
}
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
"module": "dist/esm/index.js",
"main": "dist/cjs/index.js",
"types": "dist/types/src/index.d.ts",
"files": [
"dist",
"LICENSE",
Expand All @@ -22,7 +29,10 @@
"url": "ssh://[email protected]:1inch/limit-order-sdk.git"
},
"scripts": {
"build": "tsc",
"build": "npm run build:esm && npm run build:cjs && npm run build:types",
"build:esm": "tsc --project tsconfig.esm.json",
"build:cjs": "tsc --project tsconfig.cjs.json",
"build:types": "tsc --project tsconfig.types.json",
"docs:generate": "tsdoc --src=src/limit-order/* --dest=src/limit-order/README.md && tsdoc --src=src/limit-order-contract/* --dest=src/limit-order-contract/README.md",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"lint:ci": "eslint \"{src,apps,libs,test}/**/*.ts\"",
Expand Down
4 changes: 0 additions & 4 deletions tsconfig.build.json

This file was deleted.

17 changes: 17 additions & 0 deletions tsconfig.cjs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./dist/cjs",
"module": "CommonJS",
"declaration": false,
"composite": false,
"resolveJsonModule": true,
"importHelpers": true,
},
"exclude": [
"node_modules",
"test",
"dist",
"**/*spec.ts"
]
}
17 changes: 17 additions & 0 deletions tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./dist/esm",
"module": "ESNext",
"declaration": false,
"composite": false,
"resolveJsonModule": true,
"importHelpers": true
},
"exclude": [
"node_modules",
"test",
"dist",
"**/*spec.ts"
]
}
28 changes: 14 additions & 14 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"extends": "@1inch/tsconfig",
"compilerOptions": {
"moduleResolution": "NodeNext",
"module": "ESNext",
"importHelpers": true,
"outDir": "./dist",
"rootDir": "./src",
"lib": [
"ES2021"
],
"target": "ES2021",
"removeComments": false
},
"include": ["./src"]
"extends": "@1inch/tsconfig",
"compilerOptions": {
"target": "ES2021",
"lib": ["ES2021"],
"module": "ESNext",
"moduleResolution": "Node",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"baseUrl": "./src"
},
"include": ["./src/**/*.ts", "./src/**/*.json"]
}
15 changes: 15 additions & 0 deletions tsconfig.types.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./dist/types",
"declaration": true,
"emitDeclarationOnly": true,
"composite": true
},
"exclude": [
"node_modules",
"test",
"dist",
"**/*spec.ts"
]
}

0 comments on commit 7c5b37f

Please sign in to comment.