Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 585097d

Browse files
committed
fix: Fix cjs support
1 parent a3cffc2 commit 585097d

File tree

5 files changed

+68
-63
lines changed

5 files changed

+68
-63
lines changed

.mocharc.cjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
extension: ['js', 'jsx', 'ts', 'tsx'],
3+
spec: ['tests/**.{js,ts,jsx,tsx}'],
4+
loader: 'ts-node/esm'
5+
};

package-lock.json

Lines changed: 60 additions & 60 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"version": "1.1.0",
44
"description": "Generate an AST of a BBCode fragment.",
55
"main": "dist/index.js",
6-
"type": "commonjs",
6+
"type": "module",
77
"types": "dist/index.d.ts",
88
"scripts": {
9-
"test": "mocha --require ts-node/register tests/**/*.test.ts",
9+
"test": "mocha .",
1010
"build": "tsc -b && webpack",
1111
"lint": "prettier --check . && eslint . --ext .ts",
1212
"lint-fix": "prettier --write . && eslint . --ext .ts --fix",

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"compilerOptions": {
33
"declaration": true,
4-
"module": "commonjs",
4+
"module": "ES2020",
55
"outDir": "dist",
66
"strict": true,
77
"target": "es2020",
File renamed without changes.

0 commit comments

Comments
 (0)