xiCO2k / laravel-vue-i18n

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

mix.version #57

Closed noezdev closed 2 years ago

noezdev commented 2 years ago

Using mix.version() will output app.js as the version as desired. But if you include this module here for example with mix.js('resources/js/app.js', 'public/js').vue().i18n().version(); at the end, after entering npm run prod, inside the app.js file are several (1-2) javascript files with seemingly random numbers, e.g. 501.js (without version behind it). In this 501.js file are all the translations that need to be done. Because there is no version number appended, this leads to the fact that the visitors have to empty the cache first after implementing new language variables.

Can these 501.js, 598.js etc. also be provided with version numbers?

xiCO2k commented 2 years ago

Hey @noezdev you need to set the chunkFilename on webpackConfig like this:

mix.webpackConfig({
    output: {
        chunkFilename: 'js/[name].js?id=[chunkhash]',
    },
});