Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vite-plugins-vue-i18n will listens for changes to all .json files #112

Open
4 tasks done
hooray opened this issue May 2, 2022 · 6 comments
Open
4 tasks done

vite-plugins-vue-i18n will listens for changes to all .json files #112

hooray opened this issue May 2, 2022 · 6 comments
Labels
good first issue Good for newcomers Package: vite-plugin-vue-i18n Status: PR Welcome Welcome to Pull Request Status: Proposal Request for comments

Comments

@hooray
Copy link

hooray commented May 2, 2022

Reporting a bug?

When I use the vite-plugins-vue-i18n plugin, it listens for changes to all the .json files in the project and causes vite to keep reloading

Expected behavior

should only listen to the directory specified by the include parameter

Reproduction

// vite.config.js
import path from 'path'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueI18n from '@intlify/vite-plugin-vue-i18n'

export default defineConfig({
  plugins: [
    vue(), // you need to install `@vitejs/plugin-vue`
    vueI18n({
      // if you want to use Vue I18n Legacy API, you need to set `compositionOnly: false`
      // compositionOnly: false,

      // you need to set i18n resource including paths !
      include: path.resolve(__dirname, './path/to/src/locales/**')
    })
  ]
})
// main.js

// When I import this line of code, the problem arises
import messages from '@intlify/vite-plugin-vue-i18n/messages'

Issue Package

vite-plugin-vue-i18n

System Info

windows 10

Screenshot

image
image

Additional context

No response

Validations

  • Read the Contributing Guidelines.
  • Read the README
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A open a GitHub Discussion.
@hooray hooray added the Status: Review Needed Request for review comments label May 2, 2022
@kazupon kazupon added good first issue Good for newcomers Status: PR Welcome Welcome to Pull Request Status: Proposal Request for comments Package: vite-plugin-vue-i18n and removed Status: Review Needed Request for review comments labels May 3, 2022
@productdevbook
Copy link

it also doesn't listen for languages in node_modules.

    VueI18n({
      include: [
        resolve(__dirname, '../../node_modules/@oku/i18n/src/locales/**'),
      ],
    }),
    

how to listen ?

@momtboy
Copy link

momtboy commented Mar 10, 2023

unplugin-vue-i18n the same problem occurs.
image
image
image

@staniel359
Copy link

@kazupon Any updates on this one?

Copy link
Member

kazupon commented Apr 3, 2023

If you would use to possible, I recommend to use unplugin-vue-i18n.

vite-plugin-vue-i18n only supports up to Vite 3, support security fix only.

unplugin-vue-i18n is going to official v1 release, when nuxt i18n module will have been released near the future.
(unplugin-vue-i18n is currently under development with me along with use cases for the nuxt i18n module)

@staniel359
Copy link

@kazupon I do use unplugin-vue-i18n.
And the problem is that it also listens to changes of all .json files in the project's folder.
Even when include option contains only locales folder.
How can it be fixed?

@momtboy
Copy link

momtboy commented Apr 11, 2023

@kazupon I do use unplugin-vue-i18n. And the problem is that it also listens to changes of all .json files in the project's folder. Even when include option contains only locales folder. How can it be fixed?

@kazupon I have the same problem,until now there is no solution, the same is used unplugin-vue-i18n .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers Package: vite-plugin-vue-i18n Status: PR Welcome Welcome to Pull Request Status: Proposal Request for comments
Projects
None yet
Development

No branches or pull requests

5 participants