intlify / intlify/bundle-tools

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

Open
#112 8 comments 1 reaction 0 assignees View on GitHub
good first issue status: proposal
Dominant language
TypeScript
Stars
270
Forks
46
PR merge metrics
No merged PRs in 30d

Description

### 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

```js
// 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/**')
})
]
})
```

```js
// 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

```shell
windows 10
```

### Screenshot

![image](https://user-images.githubusercontent.com/1574903/166291948-8f218b88-59fb-4631-a51a-ff6a88644b9c.png)
![image](https://user-images.githubusercontent.com/1574903/166291971-ca6b5df7-4888-4636-adfd-b028c3c8dbe1.png)

### Additional context

_No response_

### Validations

- [x] Read the [Contributing Guidelines](https://github.com/intlify/bundle-tools/blob/main/.github/contributing.md).
- [X] Read the README
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/intlify/bundle-tools/discussions).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.