Skip to content

Commit 46798d5

Browse files
authored
feat(bundle-utils,unplugin-vue-i18n): pkg option for getVueI18nVersion (#369)
* feat(bundle-utils): pkg option for `getVueI18nVersion` * fix(unplugin-vue-i18n): remove vue-i18n version checking
1 parent 331acf5 commit 46798d5

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

packages/bundle-utils/src/deps.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ export function checkInstallPackage(
3636
)
3737
}
3838

39-
type VueI18nVersion = '8' | '9' | 'unknown' | ''
39+
type VueI18nVersion = '9' | 'unknown' | ''
4040

41-
export function getVueI18nVersion(debug: Function): VueI18nVersion {
42-
const VueI18n = loadModule('vue-i18n', debug)
41+
export function getVueI18nVersion(
42+
debug: Function,
43+
pkg = 'vue-i18n'
44+
): VueI18nVersion {
45+
const VueI18n = loadModule(pkg, debug)
4346
if (VueI18n == null) {
4447
return ''
4548
}
46-
if (VueI18n.version && VueI18n.version.startsWith('8.')) {
47-
return '8'
48-
}
4949
if (VueI18n.VERSION && VueI18n.VERSION.startsWith('9.')) {
5050
return '9'
5151
}

packages/unplugin-vue-i18n/src/index.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ const debug = createDebug('unplugin-vue-i18n')
4141
const installedPkg = checkInstallPackage('@intlify/unplugin-vue-i18n', debug)
4242
const vueI18nVersion = getVueI18nVersion(debug)
4343

44-
if (vueI18nVersion === '8') {
45-
warn(`vue-i18n@8 is not supported, since sinece Vue 2 was EOL on 2023.`)
46-
}
47-
4844
export const unplugin = createUnplugin<PluginOptions>((options = {}, meta) => {
4945
debug('plugin options:', options, meta.framework)
5046

0 commit comments

Comments
 (0)