Skip to content

Commit 97b1718

Browse files
authored
Merge pull request #16781 from askoufis/loader-context-target-type
feat: Add `target` to `LoaderContext` type
2 parents b84efe6 + 5f34acf commit 97b1718

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

declarations/LoaderContext.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,12 @@ export interface LoaderRunnerLoaderContext<OptionsType> {
212212
* Example: "/abc/resource.js?query#frag"
213213
*/
214214
resource: string;
215+
216+
/**
217+
* Target of compilation.
218+
* Example: "web"
219+
*/
220+
target: string;
215221
}
216222

217223
type AdditionalData = {

types.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6595,6 +6595,12 @@ declare interface LoaderRunnerLoaderContext<OptionsType> {
65956595
* Example: "/abc/resource.js?query#frag"
65966596
*/
65976597
resource: string;
6598+
6599+
/**
6600+
* Target of compilation.
6601+
* Example: "web"
6602+
*/
6603+
target: string;
65986604
}
65996605
declare class LoaderTargetPlugin {
66006606
constructor(target: string);

0 commit comments

Comments
 (0)