Skip to content

Commit 7ec0813

Browse files
feat: esm support
1 parent 7915d59 commit 7ec0813

File tree

4 files changed

+20
-12
lines changed

4 files changed

+20
-12
lines changed

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@
22
"name": "@testing-library/webdriverio",
33
"version": "1.0.1-semantically-released",
44
"description": "",
5-
"main": "dist/index.js",
6-
"types": "dist/index.d.ts",
5+
"main": "./dist/cjs/index.js",
6+
"module": "./dist/esm/index.js",
7+
"files": [
8+
"dist"
9+
],
710
"scripts": {
811
"add-contributor": "kcd-scripts contributors add",
9-
"build": "tsc -p tsconfig.build.json",
12+
"build": "tsc -p tsconfig.build.json $npm_config_flags && tsc -p tsconfig.build.esm.json $npm_config_flags",
1013
"lint": "kcd-scripts lint",
1114
"test:unit": "kcd-scripts test --no-watch --config=jest.config.js",
1215
"validate": "kcd-scripts validate build,lint,test,typecheck",
1316
"test": "wdio wdio.conf.js",
1417
"semantic-release": "semantic-release",
1518
"typecheck:async": "tsc -p ./test/async/tsconfig.json",
1619
"typecheck:sync": "tsc -p ./test/sync/tsconfig.json",
17-
"typecheck:build": "npm run build -- --noEmit",
20+
"typecheck:build": "npm run build --flags='--noEmit'",
1821
"typecheck": "npm-run-all typecheck:build typecheck:**"
1922
},
20-
"files": [
21-
"dist"
22-
],
2323
"keywords": [],
2424
"author": "",
2525
"license": "ISC",

tsconfig.build.esm.json

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

tsconfig.build.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
4-
"declaration": true,
5-
"noEmit": false
4+
"module": "commonjs",
5+
"outDir": "./dist/cjs",
6+
"noEmit": false,
67
},
7-
"exclude": ["test", "dist"]
8+
"include": ["src"]
89
}

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
"compilerOptions": {
33
"baseUrl": ".",
44
"target": "es2019",
5-
"module": "commonjs",
65
"strict": true,
76
"esModuleInterop": true,
87
"declaration": true,
98
"outDir": "./dist",
109
"skipLibCheck": true,
11-
"noEmit": true
10+
"noEmit": true,
11+
"moduleResolution": "node"
1212
},
1313
"exclude": ["test"]
1414
}

0 commit comments

Comments
 (0)