Skip to content

Commit

Permalink
correct folder names in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Sep 13, 2023
1 parent 3058270 commit 3dab3de
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ points.
Mostly, this just uses opinionated convention, and so there is
very little to configure.

Source must be in `./src`. Builds are in `./dist/cjs` for
CommonJS and `./dist/mjs` for ESM.
Source must be in `./src`. Builds are in `./dist/commonjs` for
CommonJS and `./dist/esm` for ESM.

There is very little configuration for this. The only thing to
decide is the exported paths. If you have a `./index.ts` file,
Expand Down Expand Up @@ -70,12 +70,12 @@ appropriate build target locations, like:
"exports": {
"./foo": {
"import": {
"types": "./dist/mjs/foo.d.ts",
"default": "./dist/mjs/foo.js"
"types": "./dist/esm/foo.d.ts",
"default": "./dist/esm/foo.js"
},
"require": {
"types": "./dist/cjs/foo.d.ts",
"default": "./dist/cjs/foo.js"
"types": "./dist/commonjs/foo.d.ts",
"default": "./dist/commonjs/foo.js"
}
}
}
Expand Down Expand Up @@ -183,7 +183,7 @@ Files named `*.mts` will be excluded from the CommonJS build.
Files named `*.cts` will be excluded from the ESM build.
If you need to do something one way for CJS and another way for
If you need to do something one way for CommonJS and another way for
esm, use the "Dialect Switching" trick, with the ESM code living
in `src/<whatever>.ts` and the CommonJS polyfill living in
`src/<whatever>-cjs.cts`.
Expand Down Expand Up @@ -219,7 +219,7 @@ If you don't provide that config, then the default is:
Using the `imports` field in `package.json` is not currently
supported, because this looks at the nearest `package.json` to
get local imports, and the package.json files placed in
`dist/{cjs,mjs}` can't have local imports outside of their
`dist/{commonjs,esm}` can't have local imports outside of their
folders.
There's a way it could theoretically be done, but it's a bit
Expand Down

0 comments on commit 3dab3de

Please sign in to comment.