Skip to content

Commit

Permalink
Disable tree shaking for code wirten by user
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Jun 20, 2024
1 parent 97cda7e commit 97b8697
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,6 @@ pub async fn get_server_module_options_context(
enable_typeof_window_inlining: Some(TypeofWindow::Undefined),
execution_context: Some(execution_context),
use_swc_css,
tree_shaking_mode: Some(TreeShakingMode::ModuleFragments),
import_externals: *next_config.import_externals().await?,
ignore_dynamic_requests: true,
side_effect_free_packages: next_config.optimize_package_imports().await?.clone_value(),
Expand Down Expand Up @@ -528,6 +527,7 @@ pub async fn get_server_module_options_context(
enable_webpack_loaders: foreign_enable_webpack_loaders,
// NOTE(WEB-1016) PostCSS transforms should also apply to foreign code.
enable_postcss_transform: enable_foreign_postcss_transform,
tree_shaking_mode: Some(TreeShakingMode::ModuleFragments),
..module_options_context.clone()
};

Expand Down Expand Up @@ -584,6 +584,7 @@ pub async fn get_server_module_options_context(
enable_webpack_loaders: foreign_enable_webpack_loaders,
// NOTE(WEB-1016) PostCSS transforms should also apply to foreign code.
enable_postcss_transform: enable_foreign_postcss_transform,
tree_shaking_mode: Some(TreeShakingMode::ModuleFragments),
..module_options_context.clone()
};
let internal_module_options_context = ModuleOptionsContext {
Expand Down Expand Up @@ -719,6 +720,7 @@ pub async fn get_server_module_options_context(
enable_webpack_loaders: foreign_enable_webpack_loaders,
// NOTE(WEB-1016) PostCSS transforms should also apply to foreign code.
enable_postcss_transform: enable_foreign_postcss_transform,
tree_shaking_mode: Some(TreeShakingMode::ModuleFragments),
..module_options_context.clone()
};
let internal_module_options_context = ModuleOptionsContext {
Expand Down Expand Up @@ -800,6 +802,7 @@ pub async fn get_server_module_options_context(
enable_webpack_loaders: foreign_enable_webpack_loaders,
// NOTE(WEB-1016) PostCSS transforms should also apply to foreign code.
enable_postcss_transform: enable_foreign_postcss_transform,
tree_shaking_mode: Some(TreeShakingMode::ModuleFragments),
..module_options_context.clone()
};
let internal_module_options_context = ModuleOptionsContext {
Expand Down

0 comments on commit 97b8697

Please sign in to comment.