Skip to content

Commit f3b3446

Browse files
authored
fix: export the missing PathData type (#11315)
* fix: export the missing `PathData` type * fix: rename `PathDataChunkLike` to `ChunkPathData`
1 parent 3fcc5dd commit f3b3446

File tree

3 files changed

+19
-15
lines changed

3 files changed

+19
-15
lines changed

packages/rspack/etc/core.api.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,14 @@ export type ChunkLoadingGlobal = string;
655655
// @public
656656
export type ChunkLoadingType = string | "jsonp" | "import-scripts" | "require" | "async-node" | "import";
657657

658+
// @public (undocumented)
659+
export type ChunkPathData = {
660+
id?: string;
661+
name?: string;
662+
hash?: string;
663+
contentHash?: Record<string, string>;
664+
};
665+
658666
// @public (undocumented)
659667
export class CircularDependencyRspackPlugin extends RspackBuiltinPlugin {
660668
constructor(options: CircularDependencyRspackPluginOptions);
@@ -5521,25 +5529,17 @@ export type ParserOptionsByModuleTypeUnknown = {
55215529
export type Path = string;
55225530

55235531
// @public (undocumented)
5524-
type PathData = {
5532+
export type PathData = {
55255533
filename?: string;
55265534
hash?: string;
55275535
contentHash?: string;
55285536
runtime?: string;
55295537
url?: string;
55305538
id?: string;
5531-
chunk?: Chunk | PathDataChunkLike;
5539+
chunk?: Chunk | ChunkPathData;
55325540
contentHashType?: string;
55335541
};
55345542

5535-
// @public (undocumented)
5536-
type PathDataChunkLike = {
5537-
id?: string;
5538-
name?: string;
5539-
hash?: string;
5540-
contentHash?: Record<string, string>;
5541-
};
5542-
55435543
// @public
55445544
export type Pathinfo = boolean | "verbose";
55455545

@@ -6247,8 +6247,10 @@ declare namespace rspackExports {
62476247
Asset,
62486248
AssetInfo,
62496249
Assets,
6250+
ChunkPathData,
62506251
CompilationParams,
62516252
LogEntry,
6253+
PathData,
62526254
Compilation,
62536255
Compiler,
62546256
MultiCompilerOptions,

packages/rspack/src/Compilation.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export interface Asset {
7979
info: AssetInfo;
8080
}
8181

82-
export type PathDataChunkLike = {
82+
export type ChunkPathData = {
8383
id?: string;
8484
name?: string;
8585
hash?: string;
@@ -93,7 +93,7 @@ export type PathData = {
9393
runtime?: string;
9494
url?: string;
9595
id?: string;
96-
chunk?: Chunk | PathDataChunkLike;
96+
chunk?: Chunk | ChunkPathData;
9797
contentHashType?: string;
9898
};
9999

packages/rspack/src/exports.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
// this is a hack to be compatible with plugin which detect webpack's version
2-
const rspackVersion = RSPACK_VERSION as string;
3-
const version = WEBPACK_VERSION as string;
2+
const rspackVersion = RSPACK_VERSION;
3+
const version = WEBPACK_VERSION;
44

55
export { rspackVersion, version };
66

77
export type {
88
Asset,
99
AssetInfo,
1010
Assets,
11+
ChunkPathData,
1112
CompilationParams,
12-
LogEntry
13+
LogEntry,
14+
PathData
1315
} from "./Compilation";
1416
export { Compilation } from "./Compilation";
1517
export { Compiler } from "./Compiler";

0 commit comments

Comments
 (0)