Skip to content

Commit af59f74

Browse files
feat: esm
1 parent 995c7eb commit af59f74

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ yarn install
9797
To build the node module:
9898

9999
```sh
100-
yarn compile -- --watch
100+
pnpm run compile --watch
101101
```
102102

103103
To build the dist files:

package.json

+4-5
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"name": "chessground",
33
"version": "7.11.1-pstrat2.48",
44
"description": "playstrategy.org chess ui, forked from lichess.org",
5-
"type": "commonjs",
6-
"main": "chessground.js",
7-
"typings": "chessground.d.ts",
5+
"type": "module",
6+
"main": "dist/chessground.js",
7+
"types": "chessground.d.ts",
88
"exports": {
99
".": "./dist/chessground.js",
1010
"./*": "./dist/*.js"
@@ -16,8 +16,7 @@
1616
]
1717
}
1818
},
19-
"dependencies": {},
20-
"devDependencies": {
19+
"dependencies": {
2120
"@typescript-eslint/eslint-plugin": "^7.7.0",
2221
"@typescript-eslint/parser": "^7.7.0",
2322
"@types/node": "20.12.2",

src/chessground.ts

+2
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,5 @@ function debounceRedraw(redrawNow: (skipSvg?: boolean) => void): () => void {
5858
});
5959
};
6060
}
61+
62+
(window as any).Chessground = Chessground; // esbuild

tsconfig.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010
"noUnusedParameters": true,
1111
"noImplicitThis": true,
1212
"noImplicitReturns": true,
13-
"moduleResolution": "Node16",
14-
"lib": ["DOM", "ES2019"],
15-
"module": "node16",
16-
"target": "ES6"
13+
"module": "esnext",
14+
"moduleResolution": "node",
15+
"resolveJsonModule": true,
16+
"target": "es2017",
17+
"lib": ["DOM", "es2017"]
1718
}
1819
}

0 commit comments

Comments
 (0)