File tree 3 files changed +11
-17
lines changed
3 files changed +11
-17
lines changed Original file line number Diff line number Diff line change @@ -69,11 +69,11 @@ deno install nypm
69
69
Import:
70
70
71
71
``` js
72
- // ESM
72
+ // ESM import
73
73
import { addDependency } from " nypm" ;
74
74
75
- // CommonJS
76
- const { addDependency } = require (" nypm" );
75
+ // or dynamic import
76
+ const { addDependency } = await import (" nypm" );
77
77
```
78
78
79
79
### ` addDependency(name, options) `
Original file line number Diff line number Diff line change 1
1
import { defineBuildConfig } from "unbuild" ;
2
+ import { rm } from "node:fs/promises" ;
2
3
3
4
export default defineBuildConfig ( {
4
- rollup : {
5
- inlineDependencies : true
6
- }
5
+ hooks : {
6
+ async "build:done" ( ) {
7
+ await rm ( "dist/index.d.ts" ) ;
8
+ } ,
9
+ } ,
7
10
} ) ;
Original file line number Diff line number Diff line change 7
7
"sideEffects" : false ,
8
8
"type" : " module" ,
9
9
"exports" : {
10
- "." : {
11
- "import" : {
12
- "types" : " ./dist/index.d.mts" ,
13
- "default" : " ./dist/index.mjs"
14
- },
15
- "require" : {
16
- "types" : " ./dist/index.d.cts" ,
17
- "default" : " ./dist/index.cjs"
18
- }
19
- }
10
+ "types" : " ./dist/index.d.mts" ,
11
+ "default" : " ./dist/index.mjs"
20
12
},
21
13
"bin" : {
22
14
"nypm" : " ./dist/cli.mjs"
23
15
},
24
- "main" : " ./dist/index.cjs" ,
25
16
"module" : " ./dist/index.mjs" ,
26
17
"types" : " ./dist/index.d.ts" ,
27
18
"files" : [
You can’t perform that action at this time.
0 commit comments