Fix compatibility with leaflet

This commit is contained in:
Alex Gleason committed 2025-09-27 22:42:42 -05:00
1 parent 3529d43b91
commit 4e0625721e
1 file changed
+8
+8
View File
@@ -61,6 +61,14 @@ export function esmPlugin(packageLock: PackageLock, target?: string): Plugin {
}
});
// Legacy (Internet Explorer) "behavior" syntax
build.onResolve({ filter: /^#default#/, namespace: "esm" }, (args) => {
return {
path: args.path,
external: true,
};
});
// Handle bare imports like "react"
build.onResolve({ filter: /^[^./].*/ }, (args) => {
const packageName = args.path.startsWith("@")