File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -149,10 +149,23 @@ const getAllImportsWithNodeEnv = async (nodeEnv: NodeEnv) => {
149
149
* @returns A promise that resolves to the size limit configuration object.
150
150
*/
151
151
const getSizeLimitConfig = async ( ) : Promise < SizeLimitConfig > => {
152
+ const packageJson = await import ( './package.json' , { with : { type : 'json' } } )
153
+
152
154
const sizeLimitConfig = (
153
155
await Promise . all ( allNodeEnvs . map ( getAllImportsWithNodeEnv ) )
154
156
) . flat ( )
155
157
158
+ if ( 'dependencies' in packageJson ) {
159
+ const sizeLimitConfigWithoutDependencies = sizeLimitConfig . map < Check > (
160
+ ( check ) => ( {
161
+ ...check ,
162
+ name : `${ check . name } (excluding dependencies)` ,
163
+ ignore : Object . keys ( packageJson . dependencies ) ,
164
+ } ) ,
165
+ )
166
+ return sizeLimitConfig . concat ( sizeLimitConfigWithoutDependencies )
167
+ }
168
+
156
169
return sizeLimitConfig
157
170
}
158
171
You can’t perform that action at this time.
0 commit comments