@@ -11,55 +11,6 @@ const allNodeEnvs = ['development', 'production'] as const
11
11
*/
12
12
type NodeEnv = ( typeof allNodeEnvs ) [ number ]
13
13
14
- /**
15
- * Set of entry points from the `package.json` file.
16
- */
17
- const packageJsonEntryPoints = new Set < string > ( )
18
-
19
- /**
20
- * Recursively collects entry points from the `package.json` exports field.
21
- *
22
- * @param packageJsonExports - The exports field from `package.json`.
23
- * @returns A set of package entry points.
24
- */
25
- const collectPackageJsonExports = (
26
- packageJsonExports :
27
- | string
28
- | Record < string , any >
29
- | null
30
- | typeof import ( './package.json' ) . exports ,
31
- ) => {
32
- if (
33
- typeof packageJsonExports === 'string' &&
34
- packageJsonExports . endsWith ( 'js' )
35
- ) {
36
- packageJsonEntryPoints . add (
37
- packageJsonExports . startsWith ( './' )
38
- ? packageJsonExports
39
- : `./${ packageJsonExports } ` ,
40
- )
41
- } else if ( packageJsonExports && typeof packageJsonExports === 'object' ) {
42
- Object . values ( packageJsonExports ) . forEach ( collectPackageJsonExports )
43
- }
44
-
45
- return packageJsonEntryPoints
46
- }
47
-
48
- /**
49
- * Gets all package entry points from the `package.json` file.
50
- *
51
- * @returns A promise that resolves to an array of unique package entry points.
52
- */
53
- const getAllPackageEntryPoints = async ( ) => {
54
- const packageJson = (
55
- await import ( './package.json' , { with : { type : 'json' } } )
56
- ) . default
57
-
58
- const packageExports = collectPackageJsonExports ( packageJson . exports )
59
-
60
- return [ ...packageExports ]
61
- }
62
-
63
14
/**
64
15
* Gets all import configurations for a given entry point.
65
16
* This function dynamically imports the specified entry point and
@@ -121,7 +72,7 @@ const setNodeEnv = (nodeEnv: NodeEnv) => {
121
72
* @returns A promise that resolves to a size limit configuration object.
122
73
*/
123
74
const getAllImportsWithNodeEnv = async ( nodeEnv : NodeEnv ) => {
124
- const allPackageEntryPoints = await getAllPackageEntryPoints ( )
75
+ const allPackageEntryPoints = [ './dist/react-redux.mjs' ]
125
76
126
77
const allImportsFromAllEntryPoints = (
127
78
await Promise . all ( allPackageEntryPoints . map ( getAllImportsForEntryPoint ) )
0 commit comments