Skip to content
Open
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
8 changes: 6 additions & 2 deletions packages/unplugin-vue-i18n/src/core/resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import {
import { assign, generateCodeFrame, isEmptyObject } from '@intlify/shared'
import { createFilter } from '@rollup/pluginutils'
import createDebug from 'debug'
import { globSync } from 'tinyglobby'
import { genImport, genSafeVariableName } from 'knitwork'
import { findStaticImports } from 'mlly'
import { createHash } from 'node:crypto'
import fs from 'node:fs'
import { dirname, parse as parsePath, resolve } from 'node:path'
import { globSync } from 'tinyglobby'
import { parse } from 'vue/compiler-sfc'
import { checkVuePlugin, error, getVitePlugin, raiseError, resolveNamespace, warn } from '../utils'
import { getVueCompiler, parseVueRequest } from '../vue'
Expand Down Expand Up @@ -60,7 +60,11 @@ export function resourcePlugin(opts: ResolvedOptions, meta: UnpluginContextMeta)

const resourcePaths = new Set<string>()
for (const inc of opts.include || []) {
for (const resourcePath of globSync(inc, { ignore: opts.exclude, expandDirectories: false })) {
for (const resourcePath of globSync(inc, {
ignore: opts.exclude,
expandDirectories: false,
absolute: true
})) {
resourcePaths.add(resourcePath)
}
}
Expand Down
5 changes: 3 additions & 2 deletions packages/unplugin-vue-i18n/test/utils.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { isBoolean, isString } from '@intlify/shared'
import vue from '@vitejs/plugin-vue'
import { glob } from 'tinyglobby'
import { JSDOM, VirtualConsole } from 'jsdom'
import memoryfs from 'memory-fs'
import { dirname, resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
import { glob } from 'tinyglobby'
import { build } from 'vite'
import { VueLoaderPlugin } from 'vue-loader'
import webpack from 'webpack'
Expand Down Expand Up @@ -55,7 +55,8 @@ async function bundleVite(

if (ignoreIds == null) {
ignoreIds = await glob(resolve(__dirname, './fixtures/directives/*.vue'), {
expandDirectories: false
expandDirectories: false,
absolute: true
})
}

Expand Down
Loading