Skip to content

Commit

Permalink
fix: use environment.config instead of api.getNormalizedConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
9aoy committed Jun 28, 2024
1 parent 0c94ef6 commit bf8bd9b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/core/src/plugins/fileSize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,8 @@ export const pluginFileSize = (): RsbuildPlugin => ({
}

const logs = await Promise.all(
Object.keys(environments).map(async (environment, index) => {
const { printFileSize } = api.getNormalizedConfig({
environment,
}).performance;
Object.values(environments).map(async (environment, index) => {
const { printFileSize } = environment.config.performance;

const multiStats = 'stats' in stats ? stats.stats : [stats];

Expand All @@ -218,7 +216,7 @@ export const pluginFileSize = (): RsbuildPlugin => ({
printFileSizeConfig,
multiStats[index],
api.context.rootPath,
environment,
environment.name,
);
}
return [];
Expand Down

0 comments on commit bf8bd9b

Please sign in to comment.