diff --git a/packages/nuxt3/src/global-imports/module.ts b/packages/nuxt3/src/global-imports/module.ts index c599513b35..04b5040f9a 100644 --- a/packages/nuxt3/src/global-imports/module.ts +++ b/packages/nuxt3/src/global-imports/module.ts @@ -1,7 +1,7 @@ import { addVitePlugin, addWebpackPlugin, defineNuxtModule, addTemplate, resolveAlias, addPluginTemplate } from '@nuxt/kit' import { resolve } from 'upath' import type { Identifiers, GlobalImportsOptions } from './types' -import { TrsnsformPlugin } from './transform' +import { TransformPlugin } from './transform' import { defaultIdentifiers } from './identifiers' export default defineNuxtModule({ @@ -22,8 +22,8 @@ export default defineNuxtModule({ }) } else { // Transform to inject imports in production mode - addVitePlugin(TrsnsformPlugin.vite(identifiers)) - addWebpackPlugin(TrsnsformPlugin.webpack(identifiers)) + addVitePlugin(TransformPlugin.vite(identifiers)) + addWebpackPlugin(TransformPlugin.webpack(identifiers)) } // Add types diff --git a/packages/nuxt3/src/global-imports/transform.ts b/packages/nuxt3/src/global-imports/transform.ts index b4b3cf07a3..b39e004df5 100644 --- a/packages/nuxt3/src/global-imports/transform.ts +++ b/packages/nuxt3/src/global-imports/transform.ts @@ -11,7 +11,7 @@ const excludeRegex = [ /\b(?:const|let|var)\s*([\w\d_$]+?)\b/g ] -export const TrsnsformPlugin = createUnplugin((map: IdentifierMap) => { +export const TransformPlugin = createUnplugin((map: IdentifierMap) => { const regex = new RegExp('\\b(' + (Object.keys(map).join('|')) + ')\\b', 'g') return { diff --git a/packages/nuxt3/test/global-imports.test.ts b/packages/nuxt3/test/global-imports.test.ts index 07e7e392f3..3b4f1270b9 100644 --- a/packages/nuxt3/test/global-imports.test.ts +++ b/packages/nuxt3/test/global-imports.test.ts @@ -1,8 +1,8 @@ import { expect } from 'chai' -import { TrsnsformPlugin } from '../src/global-imports/transform' +import { TransformPlugin } from '../src/global-imports/transform' describe('module:global-imports:build', () => { - const { transform } = TrsnsformPlugin.raw({ ref: 'vue' }) + const { transform } = TransformPlugin.raw({ ref: 'vue' }) it('should correct inject', () => { expect(transform('const a = ref(0)', ''))