Skip to content

Commit

Permalink
disable esm externals for app ssr
Browse files Browse the repository at this point in the history
  • Loading branch information
ForsakenHarmony committed Jun 19, 2024
1 parent 83e1650 commit af9ce35
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/next-swc/crates/next-core/src/next_server/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,19 @@ pub async fn get_server_resolve_options_context(

external_packages.retain(|item| !transpile_packages.contains(item));

let ty = ty.into_value();

let server_external_packages_plugin = ExternalCjsModulesResolvePlugin::new(
project_path,
project_path.root(),
ExternalPredicate::Only(Vc::cell(external_packages)).cell(),
*next_config.import_externals().await?,
*next_config.import_externals().await?
&& !matches!(
ty,
ServerContextType::AppSSR { .. } | ServerContextType::AppRSC { .. }
),
);

let ty = ty.into_value();

let mut custom_conditions = vec![mode.await?.condition().to_string().into()];
custom_conditions.extend(
NextRuntime::NodeJs
Expand Down

0 comments on commit af9ce35

Please sign in to comment.