Skip to content

Commit 4cbcefb

Browse files
committed
fix: fix type error about webpack compiler
1 parent f3052d7 commit 4cbcefb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/core/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
} from './runtime/webpack'
2121
import type { TMatchVariable } from './parser'
2222
import type { IVueCSSVarsCtx, Options } from './types'
23-
23+
import type { Compiler } from 'webpack'
2424
const unplugin = createUnplugin<Options>(
2525
(options: Options = {}, meta): any => {
2626
const userOptions = initOption(options)
@@ -88,7 +88,7 @@ const unplugin = createUnplugin<Options>(
8888
// handle hmr with vite
8989
vite: vitePlugin(context),
9090
// handle hmr with webpack
91-
webpack(compiler) {
91+
webpack(compiler: Compiler) {
9292
webpackPlugin(context, compiler)
9393
},
9494
},

packages/core/runtime/webpack.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { handleVBindVariable } from './handle-variable'
55
import { handleInjectCss } from './handle-inject-css'
66
import type { IVueCSSVarsCtx } from '../types'
77
import type { MagicStringBase } from 'magic-string-ast'
8-
8+
import type { Compiler } from 'webpack'
99
// TODO: unit test
1010
export function transformPreWebpack(
1111
id: string,
@@ -48,7 +48,7 @@ export function transformPostWebpack(
4848
}
4949

5050
// TODO: unit test
51-
export const webpackPlugin = (ctx: IVueCSSVarsCtx, compiler: any) => {
51+
export const webpackPlugin = (ctx: IVueCSSVarsCtx, compiler: Compiler) => {
5252
// mark webpack hmr
5353
let modifiedFile = ''
5454
compiler.hooks.watchRun.tapAsync(NAME, (compilation1, watchRunCallBack) => {

0 commit comments

Comments
 (0)