diff --git a/crates/node_binding/binding.d.ts b/crates/node_binding/binding.d.ts index 89b0e25b8260..c41042bbc8b3 100644 --- a/crates/node_binding/binding.d.ts +++ b/crates/node_binding/binding.d.ts @@ -213,7 +213,7 @@ export function __chunk_graph_inner_get_chunk_entry_dependent_chunks_iterable(js export function __chunk_graph_inner_get_chunk_entry_modules(jsChunkUkey: number, compilation: JsCompilation): Array -export function __chunk_graph_inner_get_chunk_modules(jsChunkUkey: number, compilation: JsCompilation): Array +export function __chunk_graph_inner_get_chunk_modules(jsChunkUkey: number, compilation: JsCompilation): ModuleDTO[] export function __chunk_graph_inner_get_chunk_modules_iterable_by_source_type(jsChunkUkey: number, sourceType: string, compilation: JsCompilation): Array diff --git a/crates/rspack_binding_values/src/chunk_graph.rs b/crates/rspack_binding_values/src/chunk_graph.rs index a111dc05502e..ba56dc94b016 100644 --- a/crates/rspack_binding_values/src/chunk_graph.rs +++ b/crates/rspack_binding_values/src/chunk_graph.rs @@ -4,7 +4,10 @@ use rspack_napi::napi::Result; use crate::{JsChunk, JsCompilation, JsModule, ModuleDTOWrapper, ToJsModule}; -#[napi(js_name = "__chunk_graph_inner_get_chunk_modules")] +#[napi( + js_name = "__chunk_graph_inner_get_chunk_modules", + ts_return_type = "ModuleDTO[]" +)] pub fn get_chunk_modules(js_chunk_ukey: u32, compilation: &JsCompilation) -> Vec { let compilation = &compilation.0; let module_graph = compilation.get_module_graph(); diff --git a/packages/rspack/etc/core.api.md b/packages/rspack/etc/core.api.md index 5cb06ff5aadf..5719a7aa2877 100644 --- a/packages/rspack/etc/core.api.md +++ b/packages/rspack/etc/core.api.md @@ -57,7 +57,7 @@ import type { JsStatsError } from '@rspack/binding'; import type { JsStatsWarning } from '@rspack/binding'; import * as liteTapable from '@rspack/lite-tapable'; import { Logger as Logger_2 } from './logging/Logger'; -import type { ModuleDTO } from '@rspack/binding'; +import { ModuleDto } from '@rspack/binding'; import { RawCopyPattern } from '@rspack/binding'; import { RawCssExtractPluginOption } from '@rspack/binding'; import type { RawFuncUseCtx } from '@rspack/binding'; @@ -3196,9 +3196,9 @@ export type Mode = "development" | "production" | "none"; // @public (undocumented) export class Module { - constructor(module: JsModule | ModuleDTO, compilation?: Compilation); + constructor(module: JsModule | ModuleDto, compilation?: Compilation); // (undocumented) - static __from_binding(module: JsModule | ModuleDTO, compilation?: Compilation): Module; + static __from_binding(module: JsModule | ModuleDto, compilation?: Compilation): Module; // (undocumented) get blocks(): DependenciesBlock[]; buildInfo: Record; @@ -3212,6 +3212,8 @@ export class Module { // (undocumented) layer: null | string; // (undocumented) + readonly modules: Module[] | undefined; + // (undocumented) nameForCondition(): string | null; // (undocumented) originalSource(): Source | null; @@ -6015,13 +6017,13 @@ export const rspackOptions: z.ZodObject<{ errorsSpace: z.ZodOptional; warningsSpace: z.ZodOptional; }, "strict", z.ZodTypeAny, { + modules?: boolean | undefined; source?: boolean | undefined; publicPath?: boolean | undefined; all?: boolean | undefined; preset?: boolean | "verbose" | "normal" | "none" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | undefined; assets?: boolean | undefined; chunks?: boolean | undefined; - modules?: boolean | undefined; entrypoints?: boolean | "auto" | undefined; chunkGroups?: boolean | undefined; warnings?: boolean | undefined; @@ -6092,13 +6094,13 @@ export const rspackOptions: z.ZodObject<{ errorsSpace?: number | undefined; warningsSpace?: number | undefined; }, { + modules?: boolean | undefined; source?: boolean | undefined; publicPath?: boolean | undefined; all?: boolean | undefined; preset?: boolean | "verbose" | "normal" | "none" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | undefined; assets?: boolean | undefined; chunks?: boolean | undefined; - modules?: boolean | undefined; entrypoints?: boolean | "auto" | undefined; chunkGroups?: boolean | undefined; warnings?: boolean | undefined; @@ -7975,13 +7977,13 @@ export const rspackOptions: z.ZodObject<{ } | undefined; watch?: boolean | undefined; stats?: boolean | "verbose" | "normal" | "none" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | { + modules?: boolean | undefined; source?: boolean | undefined; publicPath?: boolean | undefined; all?: boolean | undefined; preset?: boolean | "verbose" | "normal" | "none" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | undefined; assets?: boolean | undefined; chunks?: boolean | undefined; - modules?: boolean | undefined; entrypoints?: boolean | "auto" | undefined; chunkGroups?: boolean | undefined; warnings?: boolean | undefined; @@ -8574,13 +8576,13 @@ export const rspackOptions: z.ZodObject<{ } | undefined; watch?: boolean | undefined; stats?: boolean | "verbose" | "normal" | "none" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | { + modules?: boolean | undefined; source?: boolean | undefined; publicPath?: boolean | undefined; all?: boolean | undefined; preset?: boolean | "verbose" | "normal" | "none" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | undefined; assets?: boolean | undefined; chunks?: boolean | undefined; - modules?: boolean | undefined; entrypoints?: boolean | "auto" | undefined; chunkGroups?: boolean | undefined; warnings?: boolean | undefined;