diff --git a/packages/teleport-project-generator-next/src/internationalization/locale-mapper-component.ts b/packages/teleport-project-generator-next/src/internationalization/locale-mapper-component.ts index 56284519f..ad9488a36 100644 --- a/packages/teleport-project-generator-next/src/internationalization/locale-mapper-component.ts +++ b/packages/teleport-project-generator-next/src/internationalization/locale-mapper-component.ts @@ -29,7 +29,7 @@ export const USE_ROUTER_HOOK: UIDLExternalDependency = { export const USE_GLOBAL_CONTEXT_HOOK: UIDLDependency = { type: 'local', - path: '../global-context', + path: '@/global-context', meta: { namedImport: true, }, diff --git a/packages/teleport-project-generator-next/src/internationalization/project.ts b/packages/teleport-project-generator-next/src/internationalization/project.ts index 15a5ecf70..6ea6c7b66 100644 --- a/packages/teleport-project-generator-next/src/internationalization/project.ts +++ b/packages/teleport-project-generator-next/src/internationalization/project.ts @@ -42,6 +42,18 @@ const findFileInTemplate = ( return file } +const generateJsConfigFile = () => { + return ` +{ + "compilerOptions": { + "baseUrl": ".", + "paths": { + "@/*": ["./*"] + } + } +}` +} + const generateGlobalContextFileContent = ( locales: Record, main: { @@ -151,6 +163,18 @@ export class NextProjectPlugini18nConfig implements ProjectPlugin { ], }) + const jsConfigFile = generateJsConfigFile() + files.set('jsconfig.json', { + path: [], + files: [ + { + name: 'jsconfig', + content: jsConfigFile, + fileType: FileType.JSON, + }, + ], + }) + return structure } }