1
1
use import_map:: ImportMap ;
2
- use indexmap:: IndexSet ;
3
2
use path_slash:: PathBufExt ;
4
3
use pathdiff:: diff_paths;
5
4
use regex:: Regex ;
@@ -39,8 +38,6 @@ pub struct Resolver {
39
38
pub deps : Vec < DependencyDescriptor > ,
40
39
/// jsx runtime: react | preact
41
40
pub jsx_runtime : Option < String > ,
42
- /// jsx static class names
43
- pub jsx_static_classes : IndexSet < String > ,
44
41
/// development mode
45
42
pub is_dev : bool ,
46
43
// internal
@@ -81,7 +78,6 @@ impl Resolver {
81
78
jsx_runtime,
82
79
jsx_runtime_version,
83
80
jsx_runtime_cdn_version,
84
- jsx_static_classes : IndexSet :: new ( ) ,
85
81
import_map,
86
82
graph_versions,
87
83
initial_graph_version,
@@ -112,15 +108,7 @@ impl Resolver {
112
108
}
113
109
}
114
110
local_path. push_str ( pathname. to_owned ( ) . to_slash ( ) . unwrap ( ) . as_str ( ) ) ;
115
- if is_css_url ( url. path ( ) ) {
116
- if let Some ( query) = url. query ( ) {
117
- local_path. push ( '?' ) ;
118
- local_path. push_str ( query) ;
119
- local_path. push_str ( "&module" ) ;
120
- } else {
121
- local_path. push_str ( "?module" ) ;
122
- }
123
- } else if let Some ( query) = url. query ( ) {
111
+ if let Some ( query) = url. query ( ) {
124
112
local_path. push ( '?' ) ;
125
113
local_path. push_str ( query) ;
126
114
}
@@ -249,14 +237,14 @@ impl Resolver {
249
237
}
250
238
}
251
239
252
- pub fn is_esm_sh_url ( url : & str ) -> bool {
253
- return url. starts_with ( "https://esm.sh/" ) || url. starts_with ( "http://esm.sh/" ) ;
254
- }
255
-
256
240
pub fn is_http_url ( url : & str ) -> bool {
257
241
return url. starts_with ( "https://" ) || url. starts_with ( "http://" ) ;
258
242
}
259
243
244
+ pub fn is_esm_sh_url ( url : & str ) -> bool {
245
+ return url. starts_with ( "https://esm.sh/" ) || url. starts_with ( "http://esm.sh/" ) ;
246
+ }
247
+
260
248
pub fn is_css_url ( url : & str ) -> bool {
261
249
if is_esm_sh_url ( url) {
262
250
let url = Url :: from_str ( url) . unwrap ( ) ;
@@ -267,7 +255,7 @@ pub fn is_css_url(url: &str) -> bool {
267
255
}
268
256
return false ;
269
257
}
270
- return url. ends_with ( ".css" ) || url. starts_with ( ".pcss" ) || url . starts_with ( ".postcss ") ;
258
+ return url. ends_with ( ".css" ) || url. contains ( ".css? " ) ;
271
259
}
272
260
273
261
fn is_false ( value : & bool ) -> bool {
0 commit comments