@@ -5,7 +5,7 @@ import { VitePWA } from 'vite-plugin-pwa'
55import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite'
66import fs from 'node:fs'
77import path from 'node:path'
8- import { description , appDeployName } from './package.json'
8+ import { description , appDeployName } from './package.json' with { type : 'json' }
99import 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 } ,
0 commit comments