mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
chore: fix typo
This commit is contained in:
parent
fdd30a9378
commit
45f898e108
@ -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<GlobalImportsOptions>({
|
||||
@ -22,8 +22,8 @@ export default defineNuxtModule<GlobalImportsOptions>({
|
||||
})
|
||||
} 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
|
||||
|
@ -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 {
|
||||
|
@ -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)', ''))
|
||||
|
Loading…
Reference in New Issue
Block a user