Skip to content

Commit

Permalink
fix: remove deprecated nuxt kit api
Browse files Browse the repository at this point in the history
  • Loading branch information
kazupon committed Sep 3, 2022
1 parent 655f2f6 commit 136e088
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/gen.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import createDebug from 'debug'
import { isString, isRegExp, isFunction, isArray, isObject } from '@intlify/shared'
import { templateUtils } from '@nuxt/kit'
import { generateJSON } from '@intlify/bundle-utils'
import { genImport } from 'knitwork'
import { genImport, genSafeVariableName } from 'knitwork'

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

const importMapper = new Map<string, string>()
for (const { code, path } of syncLocaleFiles) {
importMapper.set(code, templateUtils.importName(`locale_${code}`))
genCode += `${genImport(path, templateUtils.importName(`locale_${code}`))}\n`
importMapper.set(code, genSafeVariableName(`locale_${code}`))
genCode += `${genImport(path, genSafeVariableName(`locale_${code}`))}\n`
}

// prettier-ignore
Expand Down

0 comments on commit 136e088

Please sign in to comment.