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

Forcing webassets to really rebuild files. #2596

Merged
merged 1 commit into from Dec 15, 2016
Merged

Conversation

felixfontein
Copy link
Contributor

I've experiencing a problem with assets bundling: if I create a bundle out of CSS files which are all generated by a plugin, the following happens:

  • when running nikola build first, none of the CSS files are there when generating the create_bundles task, whence an empty file is written;
  • the create_bundles task is executed after executing the tasks which write the CSS files;
  • when running nikola build a second time, nikola sees the CSS files and executes the creates_bundles task another time;
  • unfortunately, webassets sees that the existing bundle CSS file is older than the source files, and decides not to rebuild it.

So the result is an empty (unchanged) CSS bundle file, even though the input files changed (they are not empty), which is clearly wrong.

From the webassets source, I extracted a way to force it to rebuild the bundles. If that doesn't work in some cases, we could also simply delete the output file before asking it to rebuild; that should have the same result.

@Kwpolska Kwpolska merged commit 16f0393 into master Dec 15, 2016
@Kwpolska Kwpolska deleted the forcing-webassets branch December 15, 2016 17:17
@felixfontein
Copy link
Contributor Author

Also thanks for merging!

@Kwpolska
Copy link
Member

PS. You could argue .build() was the right function all along, the docs assume a different use case than ours, and deep down both call bundle._build() nevertheless.

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

Successfully merging this pull request may close these issues.

None yet

2 participants