bundle-tools
bundle-tools copied to clipboard
unplugin-vue-i18n + Vue 2.7 results in vee-validate unable to load its own localizations
Reporting a bug?
I'm attempting to get precompilation working with my Vue 2.7 + vue-i18n-bridge
project due to CSP restrictions, however adding our lang
directory to the include
array results in a webpack error with vee-validate locales no longer able to be imported:
ERROR in ./node_modules/vee-validate/dist/locale/es.json 2:8
Module parse failed: Unexpected token (2:8)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| {
> "code": "es",
| "messages": {
| "alpha": "El campo {_field_} solo debe contener letras",
@ ./src/validation.js 3:0-50 7:2-4
@ ./src/main.js 3:0-22
Expected behavior
The plugin doesn't impact json files it's not responsible for.
Reproduction
https://github.com/Hawxy/vue-i18n-bridge-vee-validate-reproduction
Issue Package
unplugin-vue-i18n
System Info
System:
OS: Windows 10 10.0.22621
CPU: (32) x64 AMD Ryzen 9 5950X 16-Core Processor
Memory: 10.46 GB / 31.92 GB
Binaries:
Node: 16.17.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.17 - ~\AppData\Roaming\npm\yarn.CMD
npm: 8.12.1 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Spartan (44.22621.521.0), Chromium (105.0.1343.50)
Internet Explorer: 11.0.22621.1
npmPackages:
vue: 2.7.10 => 2.7.10
vue-i18n: ^8.27.2 => 8.27.2
Screenshot
No response
Additional context
No response
Validations
- [X] Read the Contributing Guidelines.
- [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.