Skip to content

Commit c2f083b

Browse files
committed
fix: fix the build target and __dirname issue
1 parent 2413f32 commit c2f083b

File tree

3 files changed

+19
-26
lines changed

3 files changed

+19
-26
lines changed

.eslintrc

Lines changed: 0 additions & 18 deletions
This file was deleted.

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"url": "https://github.com/triyanox/next-middleware/issues"
1515
},
1616
"homepage": "https://github.com/triyanox/next-middleware",
17-
"main": "dist/index.js",
1817
"author": {
1918
"name": "Mohamed Achaq",
2019
"email": "[email protected]",
@@ -27,6 +26,9 @@
2726
"release": "pnpm build && changeset publish",
2827
"version": "changeset version"
2928
},
29+
"module": "dist/index.js",
30+
"main": "dist/index.cjs",
31+
"typings": "dist/index.d.ts",
3032
"exports": {
3133
".": {
3234
"import": "./dist/index.js",
@@ -51,7 +53,8 @@
5153
"typescript": "^5.4.5"
5254
},
5355
"peerDependencies": {
54-
"typescript": "^5.4.5"
56+
"typescript": "^5.4.5",
57+
"next" : "^14.2.3"
5558
},
5659
"keywords": [
5760
"next",

tsup.config.ts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
import { defineConfig } from 'tsup';
22

3-
export default defineConfig({
4-
target: 'esnext',
5-
format: ['cjs', 'esm'],
6-
dts: true,
7-
shims: true,
8-
});
3+
export default defineConfig([
4+
{
5+
entry: ['src/index.ts'],
6+
clean: true,
7+
splitting: false,
8+
dts: true,
9+
sourcemap: true,
10+
format: ['cjs', 'esm'],
11+
outDir: 'dist',
12+
external: ['fsevents'],
13+
minify: true,
14+
target: 'node16',
15+
},
16+
]);

0 commit comments

Comments
 (0)