Skip to content

Commit 927067c

Browse files
author
mumiao
authored
Merge pull request #139 from LuckyFBB/feat_6.5.3_exposeWebpack
fix(ko): exposed webpack for plugin to use
2 parents 9d6ed1f + b3373de commit 927067c

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.changeset/funny-kiwis-care.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'ko': patch
3+
---
4+
5+
exposed webpack for plugin to use

packages/ko/src/core/hooks.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { AsyncSeriesWaterfallHook } from 'tapable';
22
import { HookItem, ACTION, HOOK_KEY_SET, HookOptions } from '../types';
3+
import webpack from 'webpack';
34

45
class Hooks {
56
private hooks: Record<string, Record<ACTION, HookItem[]>>;
@@ -24,7 +25,7 @@ class Hooks {
2425
tapInstance.tapPromise(
2526
{ name: hook.name, stage: hook.stage, before: hook.before },
2627
async (ctx: any) => {
27-
const result = await hook.fn(ctx);
28+
const result = await hook.fn(ctx, webpack);
2829
return ctx.concat(result);
2930
}
3031
);
@@ -33,7 +34,7 @@ class Hooks {
3334
tapInstance.tapPromise(
3435
{ name: hook.name, stage: hook.stage, before: hook.before },
3536
async ctx => {
36-
const result = await hook.fn(ctx);
37+
const result = await hook.fn(ctx, webpack);
3738
return result;
3839
}
3940
);

0 commit comments

Comments
 (0)