Skip to content

Commit

Permalink
refactor: Use loadsh entries
Browse files Browse the repository at this point in the history
  • Loading branch information
vio committed Dec 24, 2024
1 parent f9ff22f commit fd8abae
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/extract.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { OutputAsset, OutputBundle, OutputChunk, RenderedModule } from 'rollup';
import omit from 'lodash/omit.js';
import entries from 'lodash/entries.js';
import { type ExcludeFilepathPatterns, checkExcludeFilepath } from './utils/check-exclude-filepath';

export type AssetStats = Omit<OutputAsset, 'source'> & {
Expand Down Expand Up @@ -38,7 +39,7 @@ export default function extractRollupStats(bundle: OutputBundle, options: StatsO

const output: Stats = {};

Object.entries(bundle).forEach(([bundleEntryFilepath, bundleEntryStats]) => {
entries(bundle).forEach(([bundleEntryFilepath, bundleEntryStats]) => {
// Skip extraction if the entry filepath matches the exclude assets pattern
if (checkExcludeFilepath(bundleEntryFilepath, excludeAssets)) {
return;
Expand Down Expand Up @@ -68,7 +69,7 @@ export default function extractRollupStats(bundle: OutputBundle, options: StatsO
// Extract chunk modules stats
const chunkModulesStats: ChunkStats['modules'] = {};

Object.entries(chunkStats.modules).forEach(([bundleModuleFilepath, bundleModuleStats]) => {
entries(chunkStats.modules).forEach(([bundleModuleFilepath, bundleModuleStats]) => {
// Skip module extraction if the filepath matches the exclude modules pattern
if (checkExcludeFilepath(bundleModuleFilepath, excludeModules)) {
return;
Expand Down

0 comments on commit fd8abae

Please sign in to comment.