Skip to content

It's not auto import component in .jsx #852

@ngd-b

Description

@ngd-b

Describe the bug

When I use ElementPlusResolver to auto import element-plus component In the vue3 project. But it is not auto import in .jsx file

the vite.config.js like this:

{
  plugins:[
   AutoImport({
        imports: ["vue"],
        resolvers: [
          ElementPlusResolver(),
          IconsResolver({
            prefix: "Icon",
          }),
        ],
        extensions: ["vue", "jsx", "tsx"],
      }),
      Components({
        resolvers: [
          // 自动注册图标组件
          IconsResolver({
            enabledCollections: ["ep"],
          }),
          ElementPlusResolver(),
        ],
        extensions: ["vue", "jsx", "tsx"],
      }),
 ]
}

It's only efficient in .vue component. But it's not ok in .jsx

Reproduction

https://github.com/ngd-b/vue-vite/tree/unplugin-vue-components

System Info

mac apple m2 ; chrome

Used Package Manager

npm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy