Skip to content

Commit 94f08be

Browse files
committed
chore: commonjs support only
1 parent 549b8eb commit 94f08be

File tree

5 files changed

+24
-24
lines changed

5 files changed

+24
-24
lines changed

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# build
2-
lib
1+
# Build
2+
dist/
33

44
# Cache
55
.cache

jsdoc.config.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
},
88
"source": {
99
"include": [
10-
"lib/esm",
10+
"dist",
1111
"package.json",
1212
"README.md"
1313
],

package.json

+14-14
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,16 @@
22
"name": "exception",
33
"version": "0.0.0",
44
"description": "Exception is a custom error library for Node.js that provides a more flexible and customizable way of handling errors.",
5-
"author": "Zhang Zixin (kabeep)",
6-
"homepage": "https://github.com/kabeep/exception#readme",
7-
"repository": "[email protected]:kabeep/exception.git",
8-
"license": "MIT",
9-
"main": "./lib/index.js",
10-
"module": "./lib/esm/index.mjs",
11-
"types": "./lib/index.d.ts",
5+
"main": "./dist/index.js",
6+
"types": "./dist/index.d.ts",
127
"files": [
13-
"lib"
8+
"dist"
149
],
1510
"scripts": {
16-
"docs": "jsdoc -c jsdoc.config.json && ./docs/index.html",
11+
"docs": "jsdoc -c jsdoc.config.json",
1712
"lint": "xo src/**/*.ts --fix",
1813
"test": "vitest run",
19-
"coverage": "vitest run --coverage && ./coverage/index.html",
14+
"coverage": "vitest run --coverage",
2015
"watch": "tsup --watch",
2116
"watch:test": "vitest",
2217
"build": "tsup --dts --treeshake smallest",
@@ -38,9 +33,10 @@
3833
"dependencies": {
3934
"chalk": "^4.1.2"
4035
},
41-
"engines": {
42-
"node": ">=14"
43-
},
36+
"author": "Zhang Zixin (kabeep)",
37+
"homepage": "https://github.com/kabeep/exception#readme",
38+
"repository": "[email protected]:kabeep/exception.git",
39+
"bugs": "https://github.com/kabeep/exception/issue",
4440
"keywords": [
4541
"nodejs",
4642
"error",
@@ -50,5 +46,9 @@
5046
"unexpected",
5147
"exception",
5248
"expectation"
53-
]
49+
],
50+
"engines": {
51+
"node": ">=14"
52+
},
53+
"license": "MIT"
5454
}

tsconfig.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"compilerOptions": {
3-
"target": "ESNext",
4-
"module": "CommonJS",
5-
"moduleResolution": "node",
6-
"outDir": "./lib",
3+
"target": "ES2020",
4+
"module": "node16",
5+
"moduleResolution": "node16",
6+
"outDir": "./dist",
77
"rootDir": "./src",
88
"strict": true,
99
"esModuleInterop": true,
@@ -19,6 +19,6 @@
1919
"exclude": [
2020
"node_modules",
2121
"example",
22-
"lib"
22+
"dist"
2323
]
2424
}

tsup.config.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { defineConfig } from 'tsup';
22

33
export default defineConfig({
44
entry: ['src/index.ts'],
5-
format: ['cjs', 'esm'],
6-
outDir: 'lib',
5+
format: ['cjs'],
6+
outDir: 'dist',
77
target: ['node10'],
88
// treeshake: 'smallest',
99
bundle: true,

0 commit comments

Comments
 (0)