Skip to content

Commit 9b4bea0

Browse files
committed
fix warnings in vite configuration files
1 parent a2af867 commit 9b4bea0

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

vite.config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { VitePWA } from 'vite-plugin-pwa'
55
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite'
66
import fs from 'node:fs'
77
import path from 'node:path'
8-
import { description, appDeployName } from './package.json'
8+
import { description, appDeployName } from './package.json' with { type: 'json' }
99
import legacy from '@vitejs/plugin-legacy'
1010

1111
// https://vitejs.dev/config/
@@ -59,18 +59,18 @@ export default defineConfig({
5959
}
6060
}),
6161
VueI18nPlugin({
62-
include: [path.resolve(__dirname, './src/locales/**')],
62+
include: [path.resolve(import.meta.dirname, './src/locales/**')],
6363
strictMessage: false
6464
}),
6565
// generate languages.json metadata for the brdgm.github.io game index
6666
{
6767
name: 'generate-languages-json',
6868
writeBundle() {
69-
const localesDir = path.resolve(__dirname, './src/locales')
69+
const localesDir = path.resolve(import.meta.dirname, './src/locales')
7070
const languages = fs.readdirSync(localesDir)
7171
.filter(f => f.endsWith('.json'))
7272
.map(f => f.replace('.json', ''))
73-
const outDir = path.resolve(__dirname, './dist')
73+
const outDir = path.resolve(import.meta.dirname, './dist')
7474
fs.writeFileSync(path.resolve(outDir, 'languages.json'), JSON.stringify(languages))
7575
}
7676
},

vitest.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { fileURLToPath } from 'node:url'
22
import { mergeConfig } from 'vite'
33
import { configDefaults, defineConfig } from 'vitest/config'
4-
import viteConfig from './vite.config'
4+
import viteConfig from './vite.config.ts'
55

66
export default mergeConfig(
77
viteConfig,

0 commit comments

Comments
 (0)