Skip to content

Commit

Permalink
refactor: improve webpack loader type
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Mar 18, 2023
1 parent 268481f commit 0b6742c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/webpack/loaders/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import type { LoaderContext } from 'webpack'
import type { UnpluginContext } from '../../types'
import { createContext } from '../context'

export default async function transform(this: LoaderContext<any>, source: string, map: any) {
export default async function transform(this: LoaderContext<{ unpluginName: string }>, source: string, map: any) {
const callback = this.async()

let unpluginName
let unpluginName: string
if (typeof this.query === 'string') {
const query = new URLSearchParams(this.query)
unpluginName = query.get('unpluginName')
unpluginName = query.get('unpluginName')!
}
else {
unpluginName = this.query.unpluginName
Expand Down

0 comments on commit 0b6742c

Please sign in to comment.