xiCO2k / laravel-vue-i18n

Allows to connect your `Laravel` Framework translation files with `Vue`.
MIT License
621 stars 51 forks source link

Vite build not generating the php_{locale}.json file #126

Closed PixNyb closed 1 year ago

PixNyb commented 1 year ago

Running vite build does not generate the php_{locale}.json file and in turn doesn’t allow vite to compile the vue components.

At the start of running vite build the file does show up in the logs, but is nowhere to be found afterwards

Vite config:

import { defineConfig } from "vite";
import laravel from "laravel-vite-plugin";
import vue from "@vitejs/plugin-vue";
import i18n from "laravel-vue-i18n/vite";

export default defineConfig({
    plugins: [
        vue(),
        laravel({
            input: [
                "resources/sass/_main.scss",
                "resources/js/app.js",
                "node_modules/@fortawesome/fontawesome-free/css/all.css",
                "node_modules/normalize.css/normalize.css",
            ],
            refresh: true,
        }),
        i18n(),
    ],
    base: "./",
    resolve: {
        alias: {
            vue: "vue/dist/vue.esm-bundler.js",
        },
    },
});
[commonjs] Could not load /project/lang/php_en.json: ENOENT: no such file or directory, open '/project/lang/php_en.json'
transforming (87) resources/js/components/KanbanBoard.vue
xiCO2k commented 1 year ago

did this happened on vite build or on just vite?

Thanks.

PixNyb commented 1 year ago

Just vite build, vite works just fine

xiCO2k commented 1 year ago

Can you create a test repo that replicates this problem?