Skip to content

Commit

Permalink
fix: use debugger for package resolution warnings (#4873)
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Sep 8, 2021
1 parent 780ddcf commit 38de2c9
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions packages/vite/src/node/ssr/ssrExternal.ts
@@ -1,10 +1,18 @@
import fs from 'fs'
import path from 'path'
import { tryNodeResolve, InternalResolveOptions } from '../plugins/resolve'
import { isDefined, lookupFile, resolveFrom, unique } from '../utils'
import {
createDebugger,
isDefined,
lookupFile,
resolveFrom,
unique
} from '../utils'
import { ResolvedConfig } from '..'
import { createFilter } from '@rollup/pluginutils'

const debug = createDebugger('vite:ssr-external')

/**
* Heuristics for determining whether a dependency should be externalized for
* server-side rendering.
Expand Down Expand Up @@ -63,9 +71,7 @@ export function resolveSSRExternal(
requireEntry = require.resolve(id, { paths: [root] })
} catch (e) {
// resolve failed, assume include
config.logger.warn(
`Bundling package for SSR due to resolve failure. ${e.message}`
)
debug(`Failed to resolve entries for package "${id}"\n`, e)
continue
}
if (!entry) {
Expand Down

0 comments on commit 38de2c9

Please sign in to comment.