Skip to content

Commit 136e088

Browse files
committed
fix: remove deprecated nuxt kit api
1 parent 655f2f6 commit 136e088

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/gen.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import createDebug from 'debug'
22
import { isString, isRegExp, isFunction, isArray, isObject } from '@intlify/shared'
3-
import { templateUtils } from '@nuxt/kit'
43
import { generateJSON } from '@intlify/bundle-utils'
5-
import { genImport } from 'knitwork'
4+
import { genImport, genSafeVariableName } from 'knitwork'
65

76
import type { NuxtI18nOptions, NuxtI18nInternalOptions, LocaleInfo, NoNullable } from './types'
87
import type { NuxtI18nOptionsDefault } from './constants'
@@ -46,8 +45,8 @@ export function generateLoaderOptions(
4645

4746
const importMapper = new Map<string, string>()
4847
for (const { code, path } of syncLocaleFiles) {
49-
importMapper.set(code, templateUtils.importName(`locale_${code}`))
50-
genCode += `${genImport(path, templateUtils.importName(`locale_${code}`))}\n`
48+
importMapper.set(code, genSafeVariableName(`locale_${code}`))
49+
genCode += `${genImport(path, genSafeVariableName(`locale_${code}`))}\n`
5150
}
5251

5352
// prettier-ignore

0 commit comments

Comments
 (0)