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) => {
149149 * @returns A promise that resolves to the size limit configuration object.
150150 */
151151const getSizeLimitConfig = async ( ) : Promise < SizeLimitConfig > => {
152+ const packageJson = await import ( './package.json' , { with : { type : 'json' } } )
153+
152154 const sizeLimitConfig = (
153155 await Promise . all ( allNodeEnvs . map ( getAllImportsWithNodeEnv ) )
154156 ) . flat ( )
155157
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+
156169 return sizeLimitConfig
157170}
158171
You can’t perform that action at this time.
0 commit comments