-
Notifications
You must be signed in to change notification settings - Fork 511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use full build of consola for development time #1991
Comments
@cany748 Thanks a lot for the fix! I'm trying to import consola to log requests received by nitro but I still have an unformatted version of consola, what's the right way to import it? For now I'm doing it this way: import { consola } from 'consola'
consola.box({
title: `Request at ${time}`,
message: `[${event.method}] ${event.path}`
}) Thanks in advance for your advice |
Do you need the full version of consola in production mode? Try this: // nitro.config.ts
export default defineNitroConfig({
imports: { imports: [{ name: "consola", from: "consola" }] },
unenv: { alias: { consola: "consola" } },
}); And use the auto-imported |
@cany748 Thank you very much, it works! I only need consola in dev, will this method be only effetive in dev or also in production (after build)? I have a second question, why do we have to add these options to access consola when you've made the fix above which seemed to no longer mock the full build of consola in dev? |
The full version of consola will be available in Production mode
try updating the dependencies |
Context: #1761
We automatically use lighter build of consola for production but for development, we can keep using fancy logger.
The text was updated successfully, but these errors were encountered: