Skip to content

Commit fb25805

Browse files
authored
BREAKING CHANGE: drop '@intlify/vite-plugin-vue-i18n/messages' virtual module ID (#334)
1 parent 976fa56 commit fb25805

2 files changed

Lines changed: 1 addition & 18 deletions

File tree

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

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ import type { PluginOptions } from './types'
3636
import type { CodeGenOptions, DevEnv } from '@intlify/bundle-utils'
3737

3838
const INTLIFY_BUNDLE_IMPORT_ID = '@intlify/unplugin-vue-i18n/messages'
39-
const INTLIFY_BUNDLE_IMPORT_DEPRECTED_ID =
40-
'@intlify/vite-plugin-vue-i18n/messages'
4139
const VIRTUAL_PREFIX = '\0'
4240

4341
const debug = createDebug('unplugin-vue-i18n')
@@ -491,13 +489,6 @@ export const unplugin = createUnplugin<PluginOptions>((options = {}, meta) => {
491489

492490
resolveId(id: string, importer: string) {
493491
debug('resolveId', id, importer)
494-
if (id === INTLIFY_BUNDLE_IMPORT_DEPRECTED_ID) {
495-
warn(
496-
`deprected '${INTLIFY_BUNDLE_IMPORT_DEPRECTED_ID}', you should switch to '${INTLIFY_BUNDLE_IMPORT_ID}'`
497-
)
498-
return asVirtualId(id, meta.framework)
499-
}
500-
501492
if (id === INTLIFY_BUNDLE_IMPORT_ID) {
502493
return asVirtualId(id, meta.framework)
503494
}
@@ -508,9 +499,7 @@ export const unplugin = createUnplugin<PluginOptions>((options = {}, meta) => {
508499
debug('load', id)
509500
const { query } = parseVueRequest(id)
510501
if (
511-
[INTLIFY_BUNDLE_IMPORT_DEPRECTED_ID, INTLIFY_BUNDLE_IMPORT_ID].includes(
512-
getVirtualId(id, meta.framework)
513-
) &&
502+
INTLIFY_BUNDLE_IMPORT_ID === getVirtualId(id, meta.framework) &&
514503
include
515504
) {
516505
let resourcePaths = [] as string[]
@@ -552,7 +541,6 @@ export const unplugin = createUnplugin<PluginOptions>((options = {}, meta) => {
552541
return (
553542
filename.endsWith('vue') ||
554543
filename.endsWith(INTLIFY_BUNDLE_IMPORT_ID) ||
555-
filename.endsWith(INTLIFY_BUNDLE_IMPORT_DEPRECTED_ID) ||
556544
(/\.(json5?|ya?ml)$/.test(filename) && filter(filename))
557545
)
558546
}

packages/unplugin-vue-i18n/test/vite/bundle-import.test.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@ import { createMessageContext } from '@intlify/core-base'
66
testcase: 'import',
77
input: './fixtures/bundle-messages.ts',
88
fixture: '@intlify/unplugin-vue-i18n/messages'
9-
},
10-
{
11-
testcase: 'deprected import id',
12-
input: './fixtures/bundle-messages-deprecated.ts',
13-
fixture: '@intlify/vite-plugin-vue-i18n/messages'
149
}
1510
].forEach(({ testcase, input, fixture }) => {
1611
test(testcase, async () => {

0 commit comments

Comments
 (0)