Closed cliche23 closed 1 year ago
Can share your folder structure and the app.js
file?
Thanks.
Folder structure is as usual for Laravel 9 translation files.
<project root>
lang/
lv/
app.js
import { createApp, h } from 'vue';
import { createInertiaApp } from '@inertiajs/inertia-vue3';
import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers';
import { i18nVue } from 'laravel-vue-i18n';
import { ZiggyVue } from '../../vendor/tightenco/ziggy/dist/vue.m';
import { createVuetify } from 'vuetify'
import * as components from 'vuetify/components';
import * as directives from 'vuetify/directives';
import Axios from 'axios';
import { createPinia } from 'pinia';
import SimpleTypeahead from 'vue3-simple-typeahead';
import { FocusTrap } from 'focus-trap-vue'
createInertiaApp({
resolve: (name) => resolvePageComponent(`./Pages/${name}.vue`, import.meta.glob('./Pages/**/*.vue')),
setup({ el, App, props, plugin }) {
const vuetify = createVuetify({
theme: false,
components,
directives
});
const app = createApp({ render: () => h(App, props) });
app.provide('$http', Axios);
app.use(i18nVue, {
resolve: async lang => {
const langs = import.meta.glob('../../lang/*.json');
if (typeof langs[`../../lang/${lang}.json`] != "undefined") {
return await langs[`../../lang/${lang}.json`]();
}
}
})
.use(vuetify)
.use(createPinia())
.use(ZiggyVue, Ziggy)
.use(plugin)
.use(SimpleTypeahead)
.component('FocusTrap', FocusTrap)
.mount(el)
},
});
I had a similar situation to him
Could not replicate it.
Hi!
I have a problem with translation json files not being generated when deploying to production and building assets with
npm run build
. When doing local development and runningnpm run dev
everything works fine and the files are created. I am using Vite as an asset bundler and I have added the plugin in Vite config as described in readme file. Am I missing something?