Skip to content

Commit 79e17a7

Browse files
authored
fix: resource path resolution format
2 parents 3a18fdb + 61e0330 commit 79e17a7

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

packages/unplugin-vue-i18n/src/core/resource.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import {
88
import { assign, generateCodeFrame, isEmptyObject } from '@intlify/shared'
99
import { createFilter } from '@rollup/pluginutils'
1010
import createDebug from 'debug'
11-
import { globSync } from 'tinyglobby'
1211
import { genImport, genSafeVariableName } from 'knitwork'
1312
import { findStaticImports } from 'mlly'
1413
import { createHash } from 'node:crypto'
1514
import fs from 'node:fs'
1615
import { dirname, parse as parsePath, resolve } from 'node:path'
16+
import { globSync } from 'tinyglobby'
1717
import { parse } from 'vue/compiler-sfc'
1818
import { checkVuePlugin, error, getVitePlugin, raiseError, resolveNamespace, warn } from '../utils'
1919
import { getVueCompiler, parseVueRequest } from '../vue'
@@ -60,7 +60,11 @@ export function resourcePlugin(opts: ResolvedOptions, meta: UnpluginContextMeta)
6060

6161
const resourcePaths = new Set<string>()
6262
for (const inc of opts.include || []) {
63-
for (const resourcePath of globSync(inc, { ignore: opts.exclude, expandDirectories: false })) {
63+
for (const resourcePath of globSync(inc, {
64+
ignore: opts.exclude,
65+
expandDirectories: false,
66+
absolute: true
67+
})) {
6468
resourcePaths.add(resourcePath)
6569
}
6670
}

packages/unplugin-vue-i18n/test/utils.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { isBoolean, isString } from '@intlify/shared'
22
import vue from '@vitejs/plugin-vue'
3-
import { glob } from 'tinyglobby'
43
import { JSDOM, VirtualConsole } from 'jsdom'
54
import memoryfs from 'memory-fs'
65
import { dirname, resolve } from 'node:path'
76
import { fileURLToPath } from 'node:url'
7+
import { glob } from 'tinyglobby'
88
import { build } from 'vite'
99
import { VueLoaderPlugin } from 'vue-loader'
1010
import webpack from 'webpack'
@@ -55,7 +55,8 @@ async function bundleVite(
5555

5656
if (ignoreIds == null) {
5757
ignoreIds = await glob(resolve(__dirname, './fixtures/directives/*.vue'), {
58-
expandDirectories: false
58+
expandDirectories: false,
59+
absolute: true
5960
})
6061
}
6162

0 commit comments

Comments
 (0)