@tsmodule/tsmodule 40.0.8 → 40.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -14
- package/package.json +1 -1
package/README.md
CHANGED
@@ -25,6 +25,7 @@ modules** that target any platform.
|
|
25
25
|
* [React component library (using Next.js)](#react-component-library-using-nextjs)
|
26
26
|
- [Footnotes](#footnotes)
|
27
27
|
* [Module configuration](#module-configuration)
|
28
|
+
+ [Index exports](#index-exports)
|
28
29
|
+ [Package.json export](#packagejson-export)
|
29
30
|
- [License](#license)
|
30
31
|
|
@@ -200,23 +201,32 @@ type-check and declaration emit:
|
|
200
201
|
}
|
201
202
|
```
|
202
203
|
|
203
|
-
|
204
|
-
"index modules" at e.g. `src/test/index.ts` will be available at
|
205
|
-
`my-package/test`:
|
204
|
+
#### Index exports
|
206
205
|
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
"./": "./dist/index.js",
|
213
|
-
"./*": "./dist/*/index.js"
|
214
|
-
},
|
215
|
-
}
|
206
|
+
Conditional exports in package.json are configured such that "index
|
207
|
+
exports" are available at a subpath. For example:
|
208
|
+
|
209
|
+
```
|
210
|
+
src/a/b/c/index.ts
|
216
211
|
```
|
217
212
|
|
218
|
-
|
219
|
-
|
213
|
+
Will be available downstream via:
|
214
|
+
|
215
|
+
```ts
|
216
|
+
import { c } from "your-package/a/b/c"
|
217
|
+
```
|
218
|
+
|
219
|
+
**Notes:**
|
220
|
+
|
221
|
+
- Index exports are the only entry points available for import, are ones located
|
222
|
+
at `src/**/index.ts(x?)`.<sup>1</sup>
|
223
|
+
|
224
|
+
- The default package entry point for `your-package` is `src/index.ts`.
|
225
|
+
|
226
|
+
<sub><sup>1</sup> This has no restriction on internal imports between files,
|
227
|
+
which can import from each other freely, including at runtime.
|
228
|
+
However, consumers of your package will only be able to import from index
|
229
|
+
exports as shown.<sub>
|
220
230
|
|
221
231
|
#### Package.json export
|
222
232
|
|