From 5f90b99933b18db2aab125bc7cfb67e1895f2e56 Mon Sep 17 00:00:00 2001 From: Ahad Birang Date: Mon, 11 Jul 2022 12:11:23 +0200 Subject: [PATCH] fix(highlight): remove `@nuxt/kit` from runtime bundle --- package.json | 1 + src/runtime/server/api/highlight.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 6b63ddb71..2ffd683ea 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ }, "dependencies": { "@nuxt/kit": "^3.0.0-rc.4", + "consola": "^2.15.3", "csvtojson": "^2.0.10", "defu": "^6.0.0", "destr": "^1.1.1", diff --git a/src/runtime/server/api/highlight.ts b/src/runtime/server/api/highlight.ts index 4d840804c..30f8543c7 100644 --- a/src/runtime/server/api/highlight.ts +++ b/src/runtime/server/api/highlight.ts @@ -1,12 +1,12 @@ import { createError, defineLazyEventHandler, useBody } from 'h3' import { getHighlighter, BUNDLED_LANGUAGES, BUNDLED_THEMES, Lang, Theme } from 'shiki-es' -import { useLogger } from '@nuxt/kit' +import consola from 'consola' import { HighlightParams, HighlightThemedToken } from '../../types' import mdcTMLanguage from '../../assets/mdc.tmLanguage.json' import { useRuntimeConfig } from '#imports' // Re-create logger locally as utils cannot be imported from here -export const logger = useLogger('@nuxt/content') +export const logger = consola.withScope('@nuxt/content') /** * Resolve Shiki compatible lang from string.