Skip to content

Commit

Permalink
fix(type): export resource data with data type and add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
LonelySnowman committed Jan 23, 2025
1 parent 66c5e0d commit 78895c2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/rspack/src/exports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export { RspackOptionsApply, RspackOptionsApply as WebpackOptionsApply };

export type { Chunk } from "./Chunk";
export type { ChunkGroup } from "./ChunkGroup";
export type { Module, ResolveData } from "./Module";
export type { Module, ResolveData, ResourceDataWithData } from "./Module";
export { MultiStats } from "./MultiStats";
export { NormalModule } from "./NormalModule";
export type { NormalModuleFactory } from "./NormalModuleFactory";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ The `resolveForScheme` is typically used to handle module specifiers that have a
compiler.hooks.compilation.tap(
'MyPlugin',
(compilation, { normalModuleFactory }) => {
normalModuleFactory.hooks.resolveForScheme.tap('MyPlugin', resourceData => {
normalModuleFactory.hooks.resolveForScheme.for('https').tap('MyPlugin', resourceData => {
console.log(JSON.stringify(resourceData, null, 2));
});
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ compiler.hooks.compilation.tap(
compiler.hooks.compilation.tap(
'MyPlugin',
(compilation, { normalModuleFactory }) => {
normalModuleFactory.hooks.resolveForScheme.tap('MyPlugin', resourceData => {
normalModuleFactory.hooks.resolveForScheme.for('https').tap('MyPlugin', resourceData => {
console.log(JSON.stringify(resourceData, null, 2));
});
},
Expand Down

0 comments on commit 78895c2

Please sign in to comment.