Fix CSS relative imports

This commit is contained in:
Alex Gleason committed 2025-09-28 10:16:22 -05:00
1 parent 66d08d05de
commit d1d8f1dd15
1 file changed
+4
+4
View File
@@ -80,6 +80,10 @@ export function esmPlugin(packageLock: PackageLock, target?: string): Plugin {
const keys: string[] = [];
let importerPackage: string | undefined;
try {
const { pathname } = new URL(args.importer);
if (/\.css$/.test(pathname)) {
return; // CSS imports don't have external dependencies
}
importerPackage = extractPackageName(args.importer);
keys.push(
`node_modules/${importerPackage}/node_modules/${packageName}`,