Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

Commit

Permalink
fix: use consola level raw value for silent mode
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinmarrec committed Jan 5, 2023
1 parent 317f92c commit 52372de
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/generate.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { remove, mkdirp, existsSync, copy } = require('fs-extra')
const { join, resolve } = require('pathe')
const sharp = require('sharp')

const consola = _consola.create({ level: process.env.NUXT_PWA_SILENT === '1' ? _consola.LogLevel.Silent : undefined })
const consola = _consola.create({ level: process.env.NUXT_PWA_SILENT === '1' ? -Infinity : undefined })
const pkgName = require(join(__dirname, '../package.json')).name

const resizeOptions = {
Expand Down
4 changes: 2 additions & 2 deletions src/parts/icon/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { existsSync } from 'node:fs'
import { fork } from 'node:child_process'
import _consola, { LogLevel } from 'consola'
import _consola from 'consola'
import { relative, resolve } from 'pathe'
import { provider } from 'std-env'
import { joinURL } from 'ufo'
Expand All @@ -9,7 +9,7 @@ import type { PWAContext } from '../../types'
import { defaultDevices, metaFromDevice } from './splash'
import { getFileHash, makeManifestIcon } from './utils'

const consola = _consola.create({ level: process.env.NUXT_PWA_SILENT === '1' ? LogLevel.Silent : undefined })
const consola = _consola.create({ level: process.env.NUXT_PWA_SILENT === '1' ? -Infinity : undefined })

export const defaultSizes = [64, 120, 144, 152, 192, 384, 512]

Expand Down
4 changes: 2 additions & 2 deletions src/parts/workbox/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { addTemplate, useNuxt } from '@nuxt/kit'
import _consola, { LogLevel } from 'consola'
import _consola from 'consola'
import { join } from 'pathe'
import { randomString } from '../../utils'
import type { PWAContext } from '../../types'
import type { WorkboxOptions } from './types'

const consola = _consola.create({ level: process.env.NUXT_PWA_SILENT === '1' ? LogLevel.Silent : undefined })
const consola = _consola.create({ level: process.env.NUXT_PWA_SILENT === '1' ? -Infinity : undefined })

export default async (pwa: PWAContext) => {
if (!pwa.workbox || !pwa.workbox.enabled)
Expand Down

0 comments on commit 52372de

Please sign in to comment.