Add 2 fragile hacks to make Jumble compile

This commit is contained in:
Alex Gleason committed 2025-10-05 16:19:36 -05:00
1 parent c21d0cca09
commit fa434957b7
1 file changed
+13
+13
View File
@@ -227,6 +227,11 @@ export function esmPlugin(packageLock: PackageLock, target?: string): Plugin {
// Handle bare imports like "react"
build.onResolve({ filter: /^[^./].*/ }, (args) => {
// HACK: https://github.com/esm-dev/esm.sh/issues/1217
if (args.path === "yet-another-react-lightbox/styles.css") {
args.path = "yet-another-react-lightbox/dist/styles.css";
}
const packageName = args.path.startsWith("@")
? args.path.split("/").slice(0, 2).join("/")
: args.path.split("/")[0];
@@ -303,6 +308,14 @@ export function esmPlugin(packageLock: PackageLock, target?: string): Plugin {
const urlStr = url.toString();
setUrlLockPath(urlStr, childLockPath);
// HACK: https://github.com/esm-dev/esm.sh/issues/1218
if (specifier === "@lightninglabs/[email protected]") {
return {
path: urlStr,
external: true,
};
}
return {
path: urlStr,
namespace: "esm",