Skip to content

Commit

Permalink
chore(rspack): claim plugin statsResourceInfo type
Browse files Browse the repository at this point in the history
  • Loading branch information
2heal1 committed Jan 7, 2025
1 parent 3f9677d commit cf87b3a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/wet-deers-love.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@module-federation/rspack': patch
---

chore(rspack): claim plugin statsResourceInfo type
14 changes: 8 additions & 6 deletions packages/rspack/src/ModuleFederationPlugin.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
import type {
Compiler,
ModuleFederationPluginOptions,
RspackPluginInstance,
} from '@rspack/core';
import {
composeKeyWithSeparator,
moduleFederationPlugin,
Expand All @@ -14,6 +9,13 @@ import ReactBridgePlugin from '@module-federation/bridge-react-webpack-plugin';
import path from 'node:path';
import fs from 'node:fs';

import type { ResourceInfo } from '@module-federation/manifest';
import type {
Compiler,
ModuleFederationPluginOptions,
RspackPluginInstance,
} from '@rspack/core';

type ExcludeFalse<T> = T extends undefined | false ? never : T;
type SplitChunks = Compiler['options']['optimization']['splitChunks'];
type NonUndefined<T = SplitChunks> = ExcludeFalse<T>;
Expand Down Expand Up @@ -240,7 +242,7 @@ export class ModuleFederationPlugin implements RspackPluginInstance {
});
}

get statsResourceInfo() {
get statsResourceInfo(): Partial<ResourceInfo> | undefined {
return this._statsPlugin?.resourceInfo;
}
}

0 comments on commit cf87b3a

Please sign in to comment.