vitejs / vite-plugin-vue

Vite Vue Plugins
MIT License
498 stars 153 forks source link

filter advance #149

Open sushoucanyuan opened 1 year ago

sushoucanyuan commented 1 year ago

Related plugins

Description

According to the existing code:

const filter = createFilter(include || /\.[jt]sx$/, exclude)
...
if (filter(id) || filter(filepath)) {

We cannot exclude files by querying strings, for example /\?xxx$/

Suggested solution

Change the code to

const includeFilter = createFilter(include || /\.[jt]sx$/)
const excludeFilter = createFilter('**',exclude)
...
if((includeFilter(id) || includeFilter(filepath)) && excludeFilter(id) && excludeFilter(filepath)){

Alternative

No response

Additional context

No response

Validations

edison1105 commented 1 month ago

PR welcome