Created
March 31, 2022 17:01
-
-
Save mattbryson/23ca32f972380f1770bf3c136e6009d6 to your computer and use it in GitHub Desktop.
Patch to get vue-cli-plugin-i18n working in a mono repo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { defineConfig } = require('@vue/cli-service'); | |
const path = require('path'); | |
module.exports = defineConfig({ | |
chainWebpack: (config) => { | |
// Fix vue-cli-plugin-i18n broken path to the locales folder in a mono repo | |
config.module | |
.rule('i18n-resource') | |
.include.clear().add(path.resolve(__dirname, 'src/locales')); | |
}, | |
pluginOptions: { | |
i18n: { | |
locale: 'en', | |
fallbackLocale: 'en', | |
localeDir: 'locales', // in a mono repo this resolves an invalid path - like /User/bob/repo_root/src/locales - rather than /User/bob/repo_root/packages/package_root/src/locales | |
enableLegacy: false, | |
compositionOnly: true, | |
fullInstall: false, | |
runtimeOnly: true | |
} | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment