Skip to content

Commit

Permalink
fix: use debugger for package resolution warnings (vitejs#4873)
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu authored and aleclarson committed Nov 8, 2021
1 parent e84189e commit 782b26b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions packages/vite/src/node/ssr/ssrExternal.ts
Original file line number Diff line number Diff line change
@@ -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 782b26b

Please sign in to comment.