After diving into the Vue-i18n library and exploring this tutorial, I successfully incorporated tags in json format within my project created with vue-cli.
While browsing through the documentation, I noticed an example using yaml instead of json. However, there was no specific example provided for Vue-Cli 3 Webpack management.
In an attempt to integrate yaml support into my project, I implemented the following code snippet:
// vue.config.js
module.exports = {
chainWebpack: config => {
config.module
.rule('i18n')
.resourceQuery(/blockType=i18n/)
.use('i18n')
.loader('@kazupon/vue-i18n-loader')
.loader('yaml-loader')
.end();
}
}
Unfortunately, this approach resulted in the following error:
error in ./src/components/HelloWorld.vue?vue&type=custom&index=0&blockType=i18n
Module parse failed: Unexpected token (2:5)
You may need an appropriate loader to handle this file type.
| {
> "en": {
| "hello": "Hello !"
| }
@ ./src/components/HelloWorld.vue?vue&type=custom&index=0&blockType=i18n 1:0-233 1:249-252 1:254-484 1:254-484
@ ./src/components/HelloWorld.vue
@ ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/babel-loader/lib!./node_modules/ts-loader??ref--13-2!./node_modules/vue-loader/lib??vue-loader-options!./src/views/Home.vue?vue&type=script&lang=ts&
@ ./src/views/Home.vue?vue&type=script&lang=ts&
@ ./src/views/Home.vue
@ ./src/router.ts
@ ./src/main.ts
As I navigate through webpack-chain configurations, I'm struggling to pinpoint the missing piece. Any insights or guidance on this matter would be greatly appreciated.