Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nnnnoel committed Dec 26, 2024
1 parent 7b404c8 commit f78dd9c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
1 change: 1 addition & 0 deletions packages/next/src/build/swc/generated-native.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ export declare function projectUpdateInfoSubscribe(
export interface StackFrame {
isServer: boolean
isInternal?: boolean
originalFile?: string
file: string
line?: number
column?: number
Expand Down
24 changes: 19 additions & 5 deletions turbopack/crates/turbopack-css/src/process.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use std::{
collections::HashMap,
sync::{Arc, RwLock},
borrow::Borrow, collections::HashMap, ops::Deref, sync::{Arc, RwLock}
};

use anyhow::{bail, Result};
Expand All @@ -25,8 +24,7 @@ use turbopack_core::{
asset::{Asset, AssetContent},
chunk::{ChunkingContext, MinifyType},
issue::{
Issue, IssueExt, IssueSource, IssueStage, OptionIssueSource, OptionStyledString,
StyledString,
Issue, IssueDescriptionExt, IssueExt, IssueSource, IssueStage, OptionIssueSource, OptionStyledString, StyledString
},
reference::ModuleReferences,
reference_type::ImportContext,
Expand Down Expand Up @@ -423,8 +421,24 @@ async fn process_content(
None => None,
};

let mut path = fs_path_vc.await?.path;

for (pattern, removal) in [
(".module.scss", ".module.css"),
(".module.sass", ".module.css")
] {

if path.contains(pattern) {
path = path.replace(removal, "").into();
break;
}
}

ParsingIssue {
file: origin.origin_path().to_resolved().await?,
file: ResolvedVc::cell(FileSystemPath {
path,
..fs_path_vc.await?.deref().borrow().clone()
}),
msg: ResolvedVc::cell(err.to_string().into()),
source,
}
Expand Down

0 comments on commit f78dd9c

Please sign in to comment.