ssr.external
- Type:
string[] | true - Related: SSR Externals
true, all dependencies including linked dependencies are externalized.
Note that the explicitly listed dependencies (using string[] type) will always take priority if they’re also listed in ssr.noExternal (using any type).
ssr.noExternal
- Type:
string | RegExp | (string | RegExp)[] | true - Related: SSR Externals
ssr.external option.
If true, no dependencies are externalized. However, dependencies explicitly listed in ssr.external (using string[] type) can take priority and still be externalized. If ssr.target: 'node' is set, Node.js built-ins will also be externalized by default.
Note that if both ssr.noExternal: true and ssr.external: true are configured, ssr.noExternal takes priority and no dependencies are externalized.
ssr.target
- Type:
'node' | 'webworker' - Default:
node
ssr.resolve.conditions
- Type:
string[] - Default:
['module', 'node', 'development|production'](defaultServerConditions) (['module', 'browser', 'development|production'](defaultClientConditions) forssr.target === 'webworker') - Related: Resolve Conditions
ssr.resolve.externalConditions to affect externalized imports.
ssr.resolve.externalConditions
- Type:
string[] - Default:
['node']
ssrLoadModule) of externalized direct dependencies (external dependencies imported by Vite).
ssr.resolve.mainFields
- Type:
string[] - Default:
['module', 'jsnext:main', 'jsnext']
package.json to try when resolving a package’s entry point. Note this takes lower precedence than conditional exports resolved from the exports field: if an entry point is successfully resolved from exports, the main field will be ignored. This setting only affects non-externalized dependencies.