Failed to load .yaml
According to manual, I've set up webpack as
rules: [
{
test: /\.(json5?|ya?ml)$/, // target json, json5, yaml and yml files
type: "javascript/auto",
loader: "@intlify/vue-i18n-loader",
include: [
// Use `Rule.include` to specify the files of locale messages to be pre-compiled
path.resolve(__dirname, "./src/locale")
]
}
]
and json files are loaded just fine, but attempt to load yaml yields
TS2307: Cannot find module './locale/en.yaml' or its corresponding type declarations.
Of course I can stick with json or even js for locales, buy yaml is just much simpler to write...
This is a TypeScript error, not a runtime one. Create a shim file. Eg.
declare module '*.yaml' {
const json: Record<string, string>;
export default json;
}
@tarkhil Thank you for your feedback!
Unfortunately, I could not reproduce your reporting info. We need more of your environment (e.g Vue.js version, Vue I18n version, and more..) info to reproduce it.
Could you give us the reproduction code or repo, please?
vue-i18n-loader will be deprecated near the future We can use unplugin-vue-i18n Thanks