Skip to content

Commit 16e705d

Browse files
authored
fix: build only esm (#122)
1 parent 54f7895 commit 16e705d

File tree

4 files changed

+9
-23
lines changed

4 files changed

+9
-23
lines changed

jest.config.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ const config: Config.InitialOptions = {
1010
'^.+\\.ts$': [
1111
'ts-jest',
1212
{
13-
useESM: true,
14-
tsconfig: './tsconfig.esm.json',
13+
useESM: true
1514
},
1615
],
1716
},

package.json

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,9 @@
77
"lib",
88
"src"
99
],
10-
"exports": {
11-
".": {
12-
"import": "./lib/esm/index.js",
13-
"require": "./lib/cjs/index.js"
14-
}
15-
},
16-
"main": "./lib/cjs/index.js",
17-
"module": "./lib/esm/index.js",
10+
"type": "module",
11+
"exports": "./lib/index.js",
12+
"main": "./lib/index.js",
1813
"repository": "api-platform/api-doc-parser",
1914
"homepage": "https://github.com/api-platform/api-doc-parser",
2015
"bugs": "https://github.com/api-platform/api-doc-parser/issues",
@@ -55,7 +50,7 @@
5550
"lint": "esw --color src --ext .ts",
5651
"fix": "yarn lint --fix",
5752
"eslint-check": "eslint-config-prettier src/index.ts",
58-
"build": "rm -rf lib/* && tsc && tsc -p tsconfig.esm.json",
53+
"build": "rm -rf lib/* && tsc",
5954
"watch": "tsc --watch"
6055
},
6156
"sideEffects": false,

tsconfig.esm.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

tsconfig.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
22
"compilerOptions": {
3-
"target": "es5",
4-
"module": "commonjs",
3+
"target": "es6",
4+
"module": "esnext",
5+
"moduleResolution": "node",
56
"sourceMap": true,
6-
"outDir": "./lib/cjs",
7+
"outDir": "./lib",
78
"declaration": true,
89
"declarationMap": true,
910
"rootDir": "./src",
1011
"importHelpers": true,
1112
"strict": true,
12-
"moduleResolution": "node",
1313
"esModuleInterop": true
1414
},
1515
"exclude": [

0 commit comments

Comments
 (0)