Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify cssUrls function in helper #9

Open
rationalthinker1 opened this issue Feb 13, 2022 · 0 comments
Open

Modify cssUrls function in helper #9

rationalthinker1 opened this issue Feb 13, 2022 · 0 comments

Comments

@rationalthinker1
Copy link

I was using your helpers, thanks btw, and I realized that it didn't collect css file of the imported from main entry

function cssUrls(string $entry): array
{
    $urls = [];
    $manifest = getManifest();

    if (!empty($manifest[$entry]['css'])) {
        foreach ($manifest[$entry]['css'] as $file) {
            $urls[] = '/build/' . $file;
        }
    }

    if (!empty($manifest[$entry]['imports'])) {
        foreach ($manifest[$entry]['imports'] as $imports) {
            if (!empty($manifest[$imports]['css'])) {
                foreach ($manifest[$imports]['css'] as $cssFile) {
                    $urls[] = '/build/' . $cssFile;
                }
            }
        }
    }

    return $urls;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant