File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
swc/swc-plugin-css-variable/src Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ fn relative_posix_path(base_path: &str, filename: &str) -> String {
6262/// - "/foo/bar" -> "/foo/bar"
6363fn convert_path_to_posix ( path : & str ) -> String {
6464 lazy_static ! {
65- static ref PATH_REPLACEMENT_REGEX : Regex = Regex :: new( r":\\|\\" ) . unwrap( ) ;
65+ static ref PATH_REPLACEMENT_REGEX : Regex = Regex :: new( r":\\|\\|:/ " ) . unwrap( ) ;
6666 }
6767
6868 PATH_REPLACEMENT_REGEX . replace_all ( path, "/" ) . to_string ( )
@@ -88,6 +88,14 @@ mod tests {
8888 ) ;
8989 }
9090
91+ #[ test]
92+ fn test_relative_path_windows_forward_slash ( ) {
93+ assert_eq ! (
94+ relative_posix_path( r"E:\foo" , "E:/foo/bar/file.tsx" ) ,
95+ "bar/file.tsx"
96+ ) ;
97+ }
98+
9199 #[ test]
92100 fn test_convert_unix_path ( ) {
93101 assert_eq ! ( convert_path_to_posix( r"/foo/bar" ) , "/foo/bar" ) ;
You can’t perform that action at this time.
0 commit comments