File tree 1 file changed +37
-0
lines changed
1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -211,6 +211,29 @@ declare namespace PackageJson {
211
211
[ packageName : string ] : string ;
212
212
}
213
213
214
+ /**
215
+ Conditions which provide a way to resolve a package entry point based on the environment.
216
+ */
217
+ export type ExportCondition = LiteralUnion <
218
+ | 'import'
219
+ | 'require'
220
+ | 'node'
221
+ | 'deno'
222
+ | 'browser'
223
+ | 'electron'
224
+ | 'react-native'
225
+ | 'default' ,
226
+ string
227
+ > ;
228
+
229
+ /**
230
+ Entry points of a module, optionally with conditions and subpath exports.
231
+ */
232
+ export type Exports =
233
+ | string
234
+ | { [ key in ExportCondition ] : Exports }
235
+ | { [ key : string ] : Exports } ;
236
+
214
237
export interface NonStandardEntryPoints {
215
238
/**
216
239
An ECMAScript module ID that is the primary entry point to the program.
@@ -380,11 +403,25 @@ export type PackageJson = {
380
403
*/
381
404
files ?: string [ ] ;
382
405
406
+ /**
407
+ Resolution algorithm for importing ".js" files from the package's scope.
408
+
409
+ [Read more.](https://nodejs.org/api/esm.html#esm_package_json_type_field)
410
+ */
411
+ type ?: 'module' | 'commonjs' ;
412
+
383
413
/**
384
414
The module ID that is the primary entry point to the program.
385
415
*/
386
416
main ?: string ;
387
417
418
+ /**
419
+ Standard entry points of the package, with enhanced support for ECMAScript Modules.
420
+
421
+ [Read more.](https://nodejs.org/api/esm.html#esm_package_entry_points)
422
+ */
423
+ exports ?: PackageJson . Exports ;
424
+
388
425
/**
389
426
The executable files that should be installed into the `PATH`.
390
427
*/
You can’t perform that action at this time.
0 commit comments