Skip to content

Commit

Permalink
[docs] Fix incorrect package exports recommendation (#903)
Browse files Browse the repository at this point in the history
Fixes #902.
  • Loading branch information
developit committed Oct 21, 2021
1 parent c04bd48 commit afa74ca
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,19 @@

```jsonc
{
"name": "foo", // your package name
"name": "foo", // your package name
"type": "module",
"source": "src/foo.js", // your source code
"exports": "./dist/foo.modern.js", // where to generate the modern bundle (see below)
"main": "./dist/foo.cjs", // where to generate the CommonJS bundle
"module": "./dist/foo.module.js", // where to generate the ESM bundle
"unpkg": "./dist/foo.umd.js", // where to generate the UMD bundle (also aliased as "umd:main")
"source": "src/foo.js", // your source code
"exports": {
"require": "./dist/foo.cjs", // used for require() in Node 12+
"default": "./dist/foo.modern.js" // where to generate the modern bundle (see below)
},
"main": "./dist/foo.cjs", // where to generate the CommonJS bundle
"module": "./dist/foo.module.js", // where to generate the ESM bundle
"unpkg": "./dist/foo.umd.js", // where to generate the UMD bundle (also aliased as "umd:main")
"scripts": {
"build": "microbundle", // compiles "source" to "main"/"module"/"unpkg"
"dev": "microbundle watch" // re-build when source files change
"build": "microbundle", // compiles "source" to "main"/"module"/"unpkg"
"dev": "microbundle watch" // re-build when source files change
}
}
```
Expand Down

0 comments on commit afa74ca

Please sign in to comment.