unplugin / unplugin-vue-components

📲 On-demand components auto importing for Vue
https://www.npmjs.com/package/unplugin-vue-components
MIT License
3.77k stars 349 forks source link

An option that controls the import order of components #663

Open eiinu opened 1 year ago

eiinu commented 1 year ago

Clear and concise description of the problem

Code

// page1.vue
<template>
  <prefix-button>
  <prefix-card>
</template>

// page2.vue
<template>
  <prefix-card>
  <prefix-button>
</template>

Result

// page1.js
import 'button.css'
import 'card.css'

// page2.js
import 'card.css'
import 'button.css'

And then webpack plugin mini-css-extract-plugin will throw errors

[mini-css-extract-plugin] Conflicting order.

Suggested solution

Is it possible to control the order in which components are imported in each file?

For example, import according to the string order of component names as an optional value.

Alternative

No response

Additional context

No response

Validations

lishaobos commented 1 year ago

need reproduction