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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix purgecss plugin crashing when using scss #733

Merged
merged 1 commit into from
Mar 22, 2023

Conversation

goulvench
Copy link
Contributor

When using SASS, the manifest key is index.scss instead of index.css, raising undefined method 'split' for nil:NilClass.
The crash happens at line 24 (css_file = manifest["styles/index.css"].split("/").last).

This is a 馃悰 bug fix.

I haven't found tests for this plugin, let me know if there are that I can tweak to exercise this condition.

Summary

When a project uses scss instead of plain css, the expected manifest key is slightly different, crashing the purgecss plugin to crash. By reading either index.css or index.scss the plugin handles both cases without erroring out.

When using SASS, the manifest key is `index.scss` instead of `index.css`, raising `undefined method 'split' for nil:NilClass` on line 24.
@jaredcwhite
Copy link
Member

Looks good to me! Thanks @goulvench

@jaredcwhite jaredcwhite merged commit e246dcc into bridgetownrb:main Mar 22, 2023
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

Successfully merging this pull request may close these issues.

None yet

2 participants