[Vuejs]-Is there any way to use unplugin-vue-components with quasar-cli vite version?

1👍

it was a stupid syntax error and me being careless caused this the right format:

  vitePlugins: [
    [
      "unplugin-auto-import/vite",
      {
        // targets to transform
        include: [
          /\.[tj]sx?$/, // .ts, .tsx, .js, .jsx
          /\.vue$/,
          /\.vue\?vue/, // .vue
          /\.md$/, // .md
        ],
        imports: [
          // presets
          "vue",
          "vue-router",
          "@vueuse/core",
        ],
        dirs: [
          // './hooks',
          "src/composables", // only root modules
          "src/components/**", // all nested modules
        ],
      },
    ],
    [
      "unplugin-vue-components/vite",
      {
        // relative paths to the directory to search for components.
        dirs: ["src/components/**"],
      },
    ],
    ["unocss/vite", {}],
  ],
},

if you want unocss plugin after installing it and adding to the vitePlugins you must create an unocss boot file and use that file name inside boot array in quasar config file.

Leave a comment