File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -345,15 +345,22 @@ impl Config {
345
345
pub fn get_module ( & self ) -> String {
346
346
match & self . package_specs {
347
347
Some ( OneOrMore :: Single ( PackageSpec { module, .. } ) ) => module. to_string ( ) ,
348
- Some ( OneOrMore :: Multiple ( _) ) => panic ! ( "Multiple package specs not supported" ) ,
348
+ Some ( OneOrMore :: Multiple ( vec) ) => match vec. first ( ) {
349
+ Some ( PackageSpec { module, .. } ) => module. to_string ( ) ,
350
+ None => "commonjs" . to_string ( ) ,
351
+ } ,
349
352
_ => "commonjs" . to_string ( ) ,
350
353
}
351
354
}
352
355
353
356
pub fn get_suffix ( & self ) -> String {
354
357
match & self . package_specs {
355
358
Some ( OneOrMore :: Single ( PackageSpec { suffix, .. } ) ) => suffix. to_owned ( ) ,
356
- Some ( OneOrMore :: Multiple ( _) ) => panic ! ( "Multiple package specs not supported" ) ,
359
+ Some ( OneOrMore :: Multiple ( vec) ) => match vec. first ( ) {
360
+ Some ( PackageSpec { suffix, .. } ) => suffix. to_owned ( ) ,
361
+ None => None ,
362
+ } ,
363
+
357
364
_ => self . suffix . to_owned ( ) ,
358
365
}
359
366
. unwrap_or ( ".js" . to_string ( ) )
You can’t perform that action at this time.
0 commit comments