unplugin / unplugin-auto-import

Auto import APIs on-demand for Vite, Webpack and Rollup
MIT License
3.29k stars 198 forks source link

Custom resolver removes the first character from name parameter #134

Closed jd-solanki closed 2 years ago

jd-solanki commented 2 years ago

Hi, I have below custom resolver:

      resolvers: [
        (name: string) => {
          if (name.includes('Alert')) console.log('name :>> ', name)
        },
      ],

and I have code like:

{{ demoCodeAlertBasic }}

With above code I get following output:

name :>> emoCodeAlertBasic
jd-solanki commented 2 years ago

I have created playground example at https://github.com/jd-0001/unplugin-auto-import

Upon running the playground project you will get something like the below: image

antfu commented 2 years ago

It should be fixed I suppose