File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change 38
38
39
39
``` jsonc
40
40
{
41
- " name" : " foo" , // your package name
41
+ " name" : " foo" , // your package name
42
42
" type" : " module" ,
43
- " source" : " src/foo.js" , // your source code
44
- " exports" : " ./dist/foo.modern.js" , // where to generate the modern bundle (see below)
45
- " main" : " ./dist/foo.cjs" , // where to generate the CommonJS bundle
46
- " module" : " ./dist/foo.module.js" , // where to generate the ESM bundle
47
- " unpkg" : " ./dist/foo.umd.js" , // where to generate the UMD bundle (also aliased as "umd:main")
43
+ " source" : " src/foo.js" , // your source code
44
+ " exports" : {
45
+ " require" : " ./dist/foo.cjs" , // used for require() in Node 12+
46
+ " default" : " ./dist/foo.modern.js" // where to generate the modern bundle (see below)
47
+ },
48
+ " main" : " ./dist/foo.cjs" , // where to generate the CommonJS bundle
49
+ " module" : " ./dist/foo.module.js" , // where to generate the ESM bundle
50
+ " unpkg" : " ./dist/foo.umd.js" , // where to generate the UMD bundle (also aliased as "umd:main")
48
51
" scripts" : {
49
- " build" : " microbundle" , // compiles "source" to "main"/"module"/"unpkg"
50
- " dev" : " microbundle watch" // re-build when source files change
52
+ " build" : " microbundle" , // compiles "source" to "main"/"module"/"unpkg"
53
+ " dev" : " microbundle watch" // re-build when source files change
51
54
}
52
55
}
53
56
```
You can’t perform that action at this time.
0 commit comments