Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: compatible with vue-loader experimentalInlineMatchResource #829

Merged
merged 4 commits into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ export default {

// `customLoaderMatcher` is depreacted, use `include` instead
- customLoaderMatcher: id => id.endsWith('.md'),
+ include: [/\.vue$/, /\.vue\?vue/, /\.md$/],
+ include: [/\.vue$/, /\.vue\?vue/, /\.vue\.[tj]sx?\?vue/, /\.md$/],
}),
],
}
Expand Down Expand Up @@ -401,7 +401,7 @@ Components({

// Filters for transforming targets (components to insert the auto import)
// Note these are NOT about including/excluding components registered - use `globs` or `excludeNames` for that
include: [/\.vue$/, /\.vue\?vue/],
include: [/\.vue$/, /\.vue\?vue/, /\.vue\.[tj]sx?\?vue/],
exclude: [/[\\/]node_modules[\\/]/, /[\\/]\.git[\\/]/, /[\\/]\.nuxt[\\/]/],

// Filters for component names that will not be imported
Expand Down
7 changes: 6 additions & 1 deletion src/core/unplugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ const PLUGIN_NAME = 'unplugin:webpack'

export default createUnplugin<Options>((options = {}) => {
const filter = createFilter(
options.include || [/\.vue$/, /\.vue\?vue/, /\.vue\?v=/],
options.include || [
/\.vue$/,
/\.vue\?vue/,
/\.vue\.[tj]sx?\?vue/, // for vue-loader with experimentalInlineMatchResource enabled
/\.vue\?v=/,
],
options.exclude || [/[\\/]node_modules[\\/]/, /[\\/]\.git[\\/]/, /[\\/]\.nuxt[\\/]/],
)
const ctx: Context = new Context(options)
Expand Down