File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,11 +49,7 @@ export function getWebpackPlugin<UserOptions = {}> (
4949 // transform hook
5050 if ( plugin . transform ) {
5151 const useLoader : RuleSetUseItem [ ] = [ {
52- loader : TRANSFORM_LOADER ,
53- ident : plugin . name ,
54- options : {
55- unpluginName : plugin . name
56- }
52+ loader : `${ TRANSFORM_LOADER } ?unpluginName=${ encodeURIComponent ( plugin . name ) } `
5753 } ]
5854 const useNone : RuleSetUseItem [ ] = [ ]
5955 compiler . options . module . rules . push ( {
Original file line number Diff line number Diff line change @@ -4,7 +4,15 @@ import { createContext } from '../context'
44
55export default async function transform ( this : LoaderContext < any > , source : string , map : any ) {
66 const callback = this . async ( )
7- const { unpluginName } = this . query
7+
8+ let unpluginName
9+ if ( typeof this . query === 'string' ) {
10+ const query = new URLSearchParams ( this . query )
11+ unpluginName = query . get ( 'unpluginName' )
12+ } else {
13+ unpluginName = this . query . unpluginName
14+ }
15+
816 const plugin = this . _compiler ?. $unpluginContext [ unpluginName ]
917
1018 if ( ! plugin ?. transform ) {
You can’t perform that action at this time.
0 commit comments