Skip to content

Open-source event management and ticket selling platform — perfect for concerts, conferences, and everything in between 🎟️ If you find this project helpful, please consider giving us a star ⭐️

488 B
Raw Blame
export const routeStylesheets = (manifest, entries) => {
    const visited = new Set();
    const stylesheets = new Set();

    const visit = (key) => {
        const chunk = manifest[key];
        if (!chunk || chunk.isEntry || visited.has(key)) {
            return;
        }
        visited.add(key);
        (chunk.css ?? []).forEach((file) => stylesheets.add(file));
        (chunk.imports ?? []).forEach(visit);
    };

    entries.forEach(visit);

    return [...stylesheets];
};