Skip to content

Commit

Permalink
fix: do not error on unresolved commonjs externals
Browse files Browse the repository at this point in the history
fix #1339
  • Loading branch information
yyx990803 committed Jan 4, 2021
1 parent 804c9a3 commit 60a4708
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/vite/src/node/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,12 @@ export function onRollupWarning(
const id = warning.source
const importer = warning.importer

if (importer && /\?commonjs-external$/.test(importer)) {
// allow commonjs external...
warning.message = chalk.yellow(warning.message)
return doWarn()
}

if (id && isBuiltin(id)) {
let importingDep
if (importer) {
Expand Down

0 comments on commit 60a4708

Please sign in to comment.