File tree Expand file tree Collapse file tree 6 files changed +42
-5
lines changed Expand file tree Collapse file tree 6 files changed +42
-5
lines changed Original file line number Diff line number Diff line change 14
14
"devDependencies" : {
15
15
"@types/node" : " ^20.1.4" ,
16
16
"bun-types" : " ^0.5.8" ,
17
- "elysia" : " 0.5.0 " ,
17
+ "elysia" : " 0.5.12 " ,
18
18
"eslint" : " ^8.40.0" ,
19
19
"mitata" : " ^0.1.6" ,
20
20
"rimraf" : " 4.3" ,
21
21
"typescript" : " ^5.0.4"
22
22
},
23
23
"peerDependencies" : {
24
- "elysia" : " >= 0.5.0 "
24
+ "elysia" : " >= 0.5.12 "
25
25
},
26
26
"exports" : {
27
+ "node" : " ./dist/cjs/index.js" ,
27
28
"require" : " ./dist/cjs/index.js" ,
28
29
"import" : " ./dist/index.js" ,
29
- "node" : " ./dist/index.js" ,
30
30
"default" : " ./dist/index.js"
31
31
},
32
32
"bugs" : " https://github.com/elysiajs/elysia-static/issues" ,
40
40
"license" : " MIT" ,
41
41
"scripts" : {
42
42
"dev" : " bun run --hot example/index.ts" ,
43
- "test" : " bun wiptest" ,
43
+ "test" : " bun wiptest && npm run test:node" ,
44
+ "test:node" : " npm install --prefix ./test/node/cjs/ && npm install --prefix ./test/node/esm/ && node ./test/node/cjs/index.js && node ./test/node/esm/index.js" ,
44
45
"build" : " rimraf dist && tsc --project tsconfig.esm.json && tsc --project tsconfig.cjs.json" ,
45
46
"release" : " npm run build && npm run test && npm publish --access public"
46
47
},
47
48
"types" : " ./src/index.ts"
48
- }
49
+ }
Original file line number Diff line number Diff line change
1
+ node_modules /
2
+ package-lock.json
Original file line number Diff line number Diff line change
1
+ if ( 'Bun' in globalThis ) {
2
+ throw new Error ( '❌ Use Node.js to run this test!' ) ;
3
+ }
4
+
5
+ const { staticPlugin } = require ( '@elysiajs/static' ) ;
6
+
7
+ if ( typeof staticPlugin !== 'function' ) {
8
+ throw new Error ( '❌ CommonJS Node.js failed' ) ;
9
+ }
10
+
11
+ console . log ( '✅ CommonJS Node.js works!' ) ;
Original file line number Diff line number Diff line change
1
+ {
2
+ "type" : " commonjs" ,
3
+ "dependencies" : {
4
+ "@elysiajs/static" : " ../../.."
5
+ }
6
+ }
Original file line number Diff line number Diff line change
1
+ if ( 'Bun' in globalThis ) {
2
+ throw new Error ( '❌ Use Node.js to run this test!' ) ;
3
+ }
4
+
5
+ import { staticPlugin } from '@elysiajs/static' ;
6
+
7
+ if ( typeof staticPlugin !== 'function' ) {
8
+ throw new Error ( '❌ ESM Node.js failed' ) ;
9
+ }
10
+
11
+ console . log ( '✅ ESM Node.js works!' ) ;
Original file line number Diff line number Diff line change
1
+ {
2
+ "type" : " module" ,
3
+ "dependencies" : {
4
+ "@elysiajs/static" : " ../../.."
5
+ }
6
+ }
You can’t perform that action at this time.
0 commit comments