From fb25805b20c49ae9a76231bc40b7389854e2daeb Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Wed, 20 Dec 2023 13:31:10 +0900 Subject: [PATCH] BREAKING CHANGE: drop '@intlify/vite-plugin-vue-i18n/messages' virtual module ID (#334) --- packages/unplugin-vue-i18n/src/index.ts | 14 +------------- .../test/vite/bundle-import.test.ts | 5 ----- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/packages/unplugin-vue-i18n/src/index.ts b/packages/unplugin-vue-i18n/src/index.ts index 59ba61c..486bfb4 100644 --- a/packages/unplugin-vue-i18n/src/index.ts +++ b/packages/unplugin-vue-i18n/src/index.ts @@ -36,8 +36,6 @@ import type { PluginOptions } from './types' import type { CodeGenOptions, DevEnv } from '@intlify/bundle-utils' const INTLIFY_BUNDLE_IMPORT_ID = '@intlify/unplugin-vue-i18n/messages' -const INTLIFY_BUNDLE_IMPORT_DEPRECTED_ID = - '@intlify/vite-plugin-vue-i18n/messages' const VIRTUAL_PREFIX = '\0' const debug = createDebug('unplugin-vue-i18n') @@ -491,13 +489,6 @@ export const unplugin = createUnplugin((options = {}, meta) => { resolveId(id: string, importer: string) { debug('resolveId', id, importer) - if (id === INTLIFY_BUNDLE_IMPORT_DEPRECTED_ID) { - warn( - `deprected '${INTLIFY_BUNDLE_IMPORT_DEPRECTED_ID}', you should switch to '${INTLIFY_BUNDLE_IMPORT_ID}'` - ) - return asVirtualId(id, meta.framework) - } - if (id === INTLIFY_BUNDLE_IMPORT_ID) { return asVirtualId(id, meta.framework) } @@ -508,9 +499,7 @@ export const unplugin = createUnplugin((options = {}, meta) => { debug('load', id) const { query } = parseVueRequest(id) if ( - [INTLIFY_BUNDLE_IMPORT_DEPRECTED_ID, INTLIFY_BUNDLE_IMPORT_ID].includes( - getVirtualId(id, meta.framework) - ) && + INTLIFY_BUNDLE_IMPORT_ID === getVirtualId(id, meta.framework) && include ) { let resourcePaths = [] as string[] @@ -552,7 +541,6 @@ export const unplugin = createUnplugin((options = {}, meta) => { return ( filename.endsWith('vue') || filename.endsWith(INTLIFY_BUNDLE_IMPORT_ID) || - filename.endsWith(INTLIFY_BUNDLE_IMPORT_DEPRECTED_ID) || (/\.(json5?|ya?ml)$/.test(filename) && filter(filename)) ) } diff --git a/packages/unplugin-vue-i18n/test/vite/bundle-import.test.ts b/packages/unplugin-vue-i18n/test/vite/bundle-import.test.ts index c428cb7..bfe9f00 100644 --- a/packages/unplugin-vue-i18n/test/vite/bundle-import.test.ts +++ b/packages/unplugin-vue-i18n/test/vite/bundle-import.test.ts @@ -6,11 +6,6 @@ import { createMessageContext } from '@intlify/core-base' testcase: 'import', input: './fixtures/bundle-messages.ts', fixture: '@intlify/unplugin-vue-i18n/messages' - }, - { - testcase: 'deprected import id', - input: './fixtures/bundle-messages-deprecated.ts', - fixture: '@intlify/vite-plugin-vue-i18n/messages' } ].forEach(({ testcase, input, fixture }) => { test(testcase, async () => {