Skip to content

Commit

Permalink
the library is compiled in esm format (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
DKotsyuba authored Jun 28, 2024
1 parent 8c210db commit 7f0860e
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 13 deletions.
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,24 @@
"description": "1inch Fusion SDK",
"author": "@1inch",
"private": false,
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist",
"LICENSE",
"README.md",
"package.json"
],
"module": "dist/esm/index.js",
"main": "dist/cjs/index.js",
"types": "dist/types/src/index.d.ts",
"repository": {
"type": "git",
"url": "ssh://[email protected]:1inch/fusion-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",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"lint:ci": "eslint \"{src,apps,libs,test}/**/*.ts\"",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --ignore-path .eslintignore --fix",
Expand Down Expand Up @@ -59,6 +63,7 @@
"ts-loader": "^9.5.1",
"ts-mockito": "^2.6.1",
"ts-node": "^10.9.2",
"tslib": "2.6.3",
"typescript": "4.9.4"
},
"peerDependencies": {
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"
]
}
16 changes: 10 additions & 6 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
{
"extends": "@1inch/tsconfig",
"compilerOptions": {
"moduleResolution": "NodeNext",
"outDir": "./dist",
"rootDir": "./src",
"lib": ["ES2021"],
"target": "ES2021",
"removeComments": false
"lib": ["ES2021"],
"module": "ESNext",
"moduleResolution": "Node",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"baseUrl": "./src"
},
"include": ["./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 7f0860e

Please sign in to comment.