Skip to content

Commit 6392f45

Browse files
committed
switch to ESM
1 parent 20dabe2 commit 6392f45

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

.github/workflows/test.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ jobs:
1313
with:
1414
node-version: latest
1515

16-
- uses: pnpm/action-setup@v2
16+
- uses: pnpm/action-setup@v3
1717
with:
1818
version: 8
1919
run_install: true
2020

2121
- run: pnpm test -- --coverage
22+
env:
23+
NODE_OPTIONS: --experimental-vm-modules
2224

2325
- run: pnpm run type-coverage
2426

25-
- uses: codecov/codecov-action@v3
27+
- uses: codecov/codecov-action@v4

jest.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
module.exports = {
1+
export default {
22
coverageDirectory: "coverage",
33
coverageProvider: "v8",
4-
preset: "ts-jest",
4+
preset: "ts-jest/presets/default-esm",
55
clearMocks: true,
66
testMatch: ["<rootDir>/index.spec.ts"],
77
};

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"index.js",
1919
"index.d.ts"
2020
],
21+
"type": "module",
2122
"main": "index.js",
2223
"types": "index.d.ts",
2324
"typeCoverage": {

tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"compilerOptions": {
33
"target": "ESNext",
4-
"module": "CommonJS",
4+
"module": "ESNext",
55
"moduleResolution": "Node",
66
"lib": ["ESNext"],
77
"declaration": true,

0 commit comments

Comments
 (0)