Skip to content

Commit

Permalink
fix: disable inlineDynamicImports for ssr.target = node
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Jun 17, 2022
1 parent f586b14 commit db85598
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/vite/src/node/build.ts
Expand Up @@ -447,10 +447,11 @@ async function doBuild(
)
}

const ssrWorkerBuild = ssr && config.ssr?.target !== 'webworker'
const cjsSsrBuild = ssr && config.ssr?.format === 'cjs'
const format = output.format || (cjsSsrBuild ? 'cjs' : 'es')
const jsExt =
(ssr && config.ssr?.target !== 'webworker') || libOptions
ssrWorkerBuild || libOptions
? resolveOutputJsExtension(format, getPkgJson(config.root)?.type)
: 'js'
return {
Expand Down Expand Up @@ -478,7 +479,7 @@ async function doBuild(
inlineDynamicImports:
output.format === 'umd' ||
output.format === 'iife' ||
(ssr && typeof input === 'string'),
(ssrWorkerBuild && typeof input === 'string'),
...output
}
}
Expand Down

0 comments on commit db85598

Please sign in to comment.