Skip to content

Commit

Permalink
fix(SSU): 🐛 in case external not avaible to all entries
Browse files Browse the repository at this point in the history
  • Loading branch information
stormslowly committed Nov 20, 2024
1 parent 8b38e19 commit 28a1c38
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crates/mako/src/plugins/central_ensure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl Plugin for CentralChunkEnsure {
let map = {ensure_map};
requireModule.updateEnsure2Map = function(newMapping) {{
map = newMapping;
}}
}};
requireModule.ensure2 = function(chunkId){{
let toEnsure = map[chunkId];
if (toEnsure) {{
Expand Down
6 changes: 4 additions & 2 deletions crates/mako/src/plugins/ssu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,9 @@ require("{SSU_MOCK_JS_FILE}");
}}catch(e){{}};
let patch = require._su_patch();
console.log(patch);
try{{
{}
}}catch(e){{}}
module.export = Promise.all(
patch.map((d)=>__mako_require__.ensure(d))
).then(()=>{{
Expand Down Expand Up @@ -566,7 +568,7 @@ requireModule._su_patch = function(){{
cssChunksIdToUrlMap[key] = css_patch[key];
}}
return Object.keys(js_patch).sort();
}}
}};
"#,
serde_json::to_string(&cache.js_patch_map).unwrap(),
serde_json::to_string(&cache.css_patch_map).unwrap(),
Expand Down Expand Up @@ -598,7 +600,7 @@ requireModule._su_patch = function(){
cssChunksIdToUrlMap[key] = css_patch[key];
}
return ["node_modules"];
}"#
};"#
.to_string()])
}
}
Expand Down

0 comments on commit 28a1c38

Please sign in to comment.