Skip to content

Commit

Permalink
fix(vite-node): fix externalizing
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Mar 19, 2022
1 parent 2504318 commit 6f265e0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 10 additions & 0 deletions packages/vite-node/rollup.config.js
Expand Up @@ -18,8 +18,10 @@ const entries = {
const external = [
...Object.keys(pkg.dependencies || {}),
...Object.keys(pkg.peerDependencies || {}),
'pathe',
'birpc',
'vite',
'url',
]

const plugins = [
Expand All @@ -38,6 +40,12 @@ const plugins = [
}),
]

function onwarn(message) {
if (message.code === 'EMPTY_BUNDLE')
return
console.error(message)
}

export default () => [
{
input: entries,
Expand All @@ -49,6 +57,7 @@ export default () => [
},
external,
plugins,
onwarn,
},
{
input: entries,
Expand All @@ -60,6 +69,7 @@ export default () => [
},
external,
plugins,
onwarn,
},
{
input: entries,
Expand Down
3 changes: 2 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6f265e0

Please sign in to comment.