Skip to content

Commit

Permalink
Update internal module rule
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkirsz committed Jul 3, 2023
1 parent 70c4ddd commit e9a96a1
Showing 1 changed file with 7 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
use turbopack_binding::turbopack::{
core::reference_type::{CssReferenceSubType, ReferenceType},
turbopack::{
module_options::{ModuleRule, ModuleRuleCondition, ModuleRuleEffect, ModuleType},
transition::TransitionVc,
},
use turbopack_binding::turbopack::turbopack::{
module_options::{ModuleRule, ModuleRuleCondition, ModuleRuleEffect, ModuleType},
transition::TransitionVc,
};

use super::css_client_reference_module_type::CssClientReferenceModuleTypeVc;
Expand All @@ -13,17 +10,14 @@ pub(crate) fn get_next_css_client_reference_transforms_rule(
) -> ModuleRule {
let module_type = CssClientReferenceModuleTypeVc::new(client_transition);

ModuleRule::new(
ModuleRule::new_internal(
// Override the default module type for CSS assets. Instead, they will go through the
// custom CSS client reference module type, which will:
// 1. Chunk them through the client chunking context.
// 2. Propagate them to the client references manifest.
ModuleRuleCondition::all(vec![
ModuleRuleCondition::ReferenceType(ReferenceType::Css(CssReferenceSubType::Internal)),
ModuleRuleCondition::any(vec![ModuleRuleCondition::ResourcePathEndsWith(
".css".to_string(),
)]),
]),
ModuleRuleCondition::all(vec![ModuleRuleCondition::ResourcePathEndsWith(
".css".to_string(),
)]),
vec![ModuleRuleEffect::ModuleType(ModuleType::Custom(
module_type.into(),
))],
Expand Down

0 comments on commit e9a96a1

Please sign in to comment.