@@ -99,14 +99,36 @@ def parse_package_json(path: Path = None):
9999 dependencies = package_json .get ("dependencies" , {})
100100 exports = cast_exports (package_json )
101101
102- for module_name , module in exports .items ():
103- module = next (find_default_key (module ))
104-
102+ try :
103+ module = exports ["default" ]
105104 yield from get_static_from_abs_path (
106- str (Path (name ) / module_name ),
105+ str (Path (name ) / module ),
107106 path / module ,
108107 settings .BASE_DIR / "node_modules" ,
109108 )
109+ if name == "lit-html" :
110+ print ("lit-html" , module )
111+ except KeyError :
112+ try :
113+ module = exports ["import" ]
114+ yield from get_static_from_abs_path (
115+ name ,
116+ path / module ,
117+ settings .BASE_DIR / "node_modules" ,
118+ )
119+ if name == "lit-html" :
120+ print ("lit-html" , module )
121+ except KeyError :
122+ for module_name , module in exports .items ():
123+ if name == "lit-html" :
124+ print ("lit-html" , module )
125+ module = next (find_default_key (module ))
126+
127+ yield from get_static_from_abs_path (
128+ str (Path (name ) / module_name ),
129+ path / module ,
130+ settings .BASE_DIR / "node_modules" ,
131+ )
110132
111133 for dep_name , dep_version in dependencies .items ():
112134 dep_path = path
0 commit comments